Having issues with image hover and click functionality

My website has an image with the cursor set to pointer and a function that should show a hidden element when clicked. However, it's not working at all. When I hover over it or click on it, nothing happens. Here is a screenshot of the issue along with the relevant code. Can anyone help me figure this out? Thanks!

https://i.sstatic.net/RzADb.png

HTML:

  <div class="font-wrap">
    <div class="wrapper">
      <p class="talk-bubble">
       Join the Conversation
      </p>
        <p class="sign-in">
          Sign In to Comment
        </p>
        <img class="sign-in-img" src="<?php bloginfo('stylesheet_directory'); ?>/images/sign-in.png" />
    </div>

CSS:

.pagecontent .cols .col.two .font-wrap {
  font-family: Verdana;
}

.pagecontent .cols .col.two .wrapper {
  position:relative;
  padding-bottom:0px;
  background-color:#ffffff;
  z-index:-2;
}   
.pagecontent .cols .col.two .wrapper .sign-in-img {
  position:absolute;
  bottom:0;
  right:0;
  width:40px;
  height:40px;
  cursor: pointer;
}

.pagecontent .cols .col.two .wrapper .sign-in-img:hover {
  cursor: pointer;
}

.pagecontent .cols .col.two .sign-in {
  text-align:right;
  margin:0;
  margin-right:50px;
  padding:0;
  font-size: .6em;
  color: #808C8D;
}

.pagecontent .cols .col.two .talk-bubble {
  border:1px solid #3A7DBA;
  padding: 15px;
  background-color:#CDE5F7;
  position:relative;
  margin-right:60px;
  color: #3A7DBA;
}

.pagecontent .cols .col.two .talk-bubble:before, .talk-bubble:after {
  box-sizing:border-box;
  padding:0;
  content:'';
  width: 20px;
  height:20px;
  display:block;
  position:absolute;
  border:20px solid transparent;
}

.pagecontent .cols .col.two .talk-bubble:before {
  z-index:-1;
  border-bottom:20px solid #3A7DBA;
  right:-12px;
  bottom:-1px;
}

.pagecontent .cols .col.two .talk-bubble:after {     
  border-bottom:20px solid #CDE5F7;
  right:-10px;
  bottom:0px;
}

JS:

  $( ".sign-in-img" ).click(function() {
    $('.comments-container').show('slow');
  });

Answer №1

There is a connection to be made with your Selector:

.pagecontent .cols .col.two .wrapper .sign-in-img

This particular selector does not lead you to the desired image. To resolve this, you can use:

.sign-in-img{
  cursor: pointer;
}

By the way, if you find yourself using it frequently, I recommend creating this css code snippet:

.cursPoint{
  cursor: pointer;
}

Then, simply add the class "curspoint" to all tags where you are utilizing it! For example:

<img class="sign-in-img cursPoint" src="<?php bloginfo('stylesheet_directory'); ?>/images/sign-in.png" />

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unlocking the power of AJAX to retrieve PHP responses

Is it possible to have a PHP response displayed within a <span>..</span> on an HTML web page? If so, can someone guide me on how to achieve this or point out any issues with the existing code? Thank you in advance! ^^ <html> <head& ...

Executing a closure within a promise's callback

Currently, I am working on implementing a queue system for a web application in order to locally store failed HTTP requests for later re-execution. After reading Mozilla's documentation on closures in loops, I decided to create inner closures. When ...

PHP not receiving POST information from $.ajax call

My JavaScript triggers a POST method when the datepicker loses focus, calling the script rent-fetch-pick-up-point.php. However, the PHP script gets stuck at the if-statement because it's not receiving the POST data. The datepicker is associated with a ...

Personalized text hues for your WordPress product page

As someone who is new to all of this, please keep that in mind :/ I decided to remove the "add to cart" button from my theme (blocksy) so I could insert my own buttons within the product page under the "short description" text. I needed two "download" but ...

drag and zoom feature similar to Google Maps

Is it possible to create draggable effects similar to Google Maps on a group of div elements? Are there any JavaScript libraries available that can replicate this functionality? ...

Three-column layout using CSS fluid design

The arrangement in Column B below does not look right. I successfully created a 3-column layout with the help of this resource. However, it assumes that fixed columns A and B have the same height or start at the same vertical position. In my case, B has an ...

What could be causing the issue with the JS function that is preventing the button from

I am generating a button dynamically using my JavaScript function and then adding it to the DOM. Below is the code snippet: var button = '<button id="btnStrView" type="button" onclick=' + parent.ExecuteCommand(item.cmdIndex) + ' c ...

What is the best way to implement Redux within Next.js 13?

Currently, I am using Next JS 13 with Redux. In Next.js 12, I was able to wrap my entire application with Provider inside ./pages/_app. However, how can I achieve this in Next JS 13? Here is the code from my layout.js: import "../styles/globals.css&q ...

Unable to clone curved text in fabric.js version 5.3.0

I am currently using fabric.js version 5.3.0 and I have a requirement to clone curved text and add it to the canvas. Description: The issue I am facing is that the cloning functionality does not work properly with curved text. The cloned object does not r ...

Adjust the CSS extension within the about:config settings of Firefox

I've been using the Zotero extension and I want to adjust how TinyMCE handles paragraph spacing. I'm looking to customize the CSS in extensions.zotero.note.css by adding specific CSS rules. The reason I want to make these changes is because I fe ...

How can I display SQL results in a Jade page using Node, Express, and MySQL?

My application built with Node.js and Express is connected to a MySQL database for monitoring purposes. The code structure is as follows: In the Node file: app.get('/banners', function(req,res){ connection.query("SELECT * FROM banner_store_ ...

Conceal the scroll bar within a div set to 100% viewport

Having some difficulty with a scrollbar on my new portfolio. The layout consists of two columns, with content on the left. I need the ability to scroll without displaying the scrollbar. I attempted the code below but it did not work. Could the issue be rel ...

JavaScript post method for JSON data: no input or output values

I am currently developing a page that extracts data from an HTML table consisting of two columns and an index of a form, and then converts it into a JSON string. The intention is to pass this data into PHP for further processing, perform calculations on th ...

Tips for incorporating a local image using file:// in JavaFX WebKit

I am facing an issue with displaying a picture in a JavaFX webview using local HTML. Despite writing the code, I am unable to show the image. The URL of the image is "file:/D:/a.jpg". //Main WebViewBrowser.java public class WebViewBrowser extends Appli ...

Create a custom element in React to detect and encapsulate links

I could really use some assistance with this issue. I have a bunch of text blocks containing links and have been utilizing linkifyjs's React component to automatically wrap the links in anchor tags. However, now I am looking to add a custom button nex ...

When I hover my mouse over the items on the Navigation bar, they shift forward

Seeking assistance with a coding issue. When hovering over TOYOTA, the HONDA and CONTACT US sections move forward unexpectedly. This movement is unwanted as I would like only the next list item to display when hovering over TOYOTA and HONDA. How can I corr ...

Grab the SVG and resize it to a smaller scale

I have a small application built using Raphael.js that creates a node network with SVG and reorganizes it based on user selections. My goal is to capture the SVG image I've created and display it in a "mini-map" format at the bottom of the screen. Si ...

Creating a new line in the content of a MatDialog in Angular 7

I have a situation where I am using MatDialog and attempting to insert a new line in the content definition. I've tried using both \n and </b>, but neither of them seem to work. Is there an alternative way to achieve this without manually e ...

$_POST is unable to read POST parameters when using AJAX

I've been facing an issue with sending data to my PHP script. Interestingly, everything works smoothly when using POSTMAN and the results are displayed correctly. However, when attempting to send the data through AJAX in my HTML project, the PHP scrip ...

Transfer password securely through an ajax call

Is it secure to send a password through an Ajax request? I have a login box that makes an Ajax request to check the login credentials and receive a JSON Object with any errors. Would it be better to use form redirection instead? [EDIT] Storing the encry ...