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!

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

Changing a single image within a v-for loop of images in Vue

I am currently working with an array in Vue where I am using v-for to create 3 columns of information. Each column includes an image, and I would like to be able to change only the specific image that is being hovered over without affecting any others. How ...

Issue with React Ref: Invariant Violation when trying to addComponentAsRefTo

I'm encountering an issue while attempting to add a ref to a React component. The error message I'm seeing is as follows: invariant.js:39Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding ...

Dynamic Data Visualization using ChartJS with MySQL and PHP

I'm trying to create a line chart using chartJs that will display MySQL data. Specifically, I would like to use PHP to push the MySQL data to the chartJs. Here is an example of the MySQL table: id | page_views | visitors | month | ---------------- ...

A method for expanding the menu upwards to make room for newly added items

Looking at the images below, I have a menu that needs new items added to it while maintaining the position of the lower-left corner. Essentially, each time an entry is added, the menu should expand upwards from "the upper-left corner" while keepi ...

Combining two asynchronous requests in AJAX

In the process of customizing the form-edit-account.php template, I have added ajax requests to enhance the functionality of the account settings form. The form allows users to modify their name, surname, age, and other details. While the ajax implementati ...

jQuery alert: A TypeError was caught stating that the object being referred to does not have the 'dialog' method available

For a few days now, I have been tirelessly searching for a solution to this issue and it has caused me quite a bit of stress. My problem lies in echoing a JQuery popup script within php: echo '<link rel="stylesheet" href="http://code.jquery.c ...

Dealing with the 'routes not found' error in a Node.js Express application (troubleshooting)

Attempting to address potential missing router errors in my app.js or router file has been a challenge for me. (various solutions found on Stack Overflow have not provided the correct resolution) The current state of my app.js or router files is functiona ...

Array Filtering with Redux

I have come across similar queries, but I am still unable to find a solution. While typing in the search box, the items on the screen get filtered accordingly. However, when I delete a character from the search box, it does not show the previous items. For ...

Using Symbol.iterator in Typescript: A step-by-step guide

I have decided to upgrade my old React JavaScript app to React Typescript. While trying to reuse some code that worked perfectly fine in the old app, I encountered errors in TS - this is also my first time using TS. The data type I am exporting is as foll ...

Creating a PDF from dynamic HTML and transferring it to an AWS S3 bucket without the need to download the PDF

We have created a web application using React JS where we attempted to generate a PDF. Instead of downloading or opening the PDF in a new window, our goal is to directly upload it to an AWS S3 bucket. We have researched and tried various samples but have n ...

Calculate the total width of LI elements and apply it to the parent UL or DIV

Is there a way to calculate the Total LI width and then set the width for the parent div? Here is an example of my code: <ul> <li>dsfdsfdsfds</li> <li>dsfdsfdsfds</li> <li>dsfdsfdsfds</li> <li>dsfdsfdsfds&l ...

Tips on converting Django model into desired format for Bootstrap-tables plugin integration

I want to integrate the bootstrap-table plugin with server-side functionality using Django Rest Framework to populate the data on the table. However, I keep getting the message "No matching records found". After some investigation, I discovered that a spec ...

What are the steps to resolve issues with my dropdown menu in IE9?

I have a cool CSS built hover-over drop-down menu that I want to add to my website. It works perfectly on all browsers except for IE9. Here is the code and stylesheet I am using: Check out the code and sheet here If anyone has any insights on what might ...

Retrieve the image and insert it using an img tag

Working on a project, I want to include Instagram profile pictures by embedding them. Although I have the image URL, I am struggling to integrate it into my HTML page. Take a look at this sample: This provided link displays the Instagram profile picture. ...

Looking to modify the HTML layout in order to be compatible with a specific script

Utilizing a form validation script with required:true data-validation will stop the form from submitting and highlight invalid fields in red by adding "has-error" to the parent container when the user submits the form. In the code snippet below, "has-erro ...

Updating React state using a form input

Seeking assistance on retrieving form values and storing them in state. Despite following various guides (mostly in class style react), I keep encountering the same error: "Nothing was returned from render. This usually means a return statement is m ...

Merge the throw new Error statement with await in a single expression

Is it possible to combine throwing an error and using the await keyword in one statement using the AND operator? The code snippet below demonstrates my intention: throw new Error() && await client.end(). So far, this approach has been working wel ...

How can you determine if a domain belongs to Shopify when given a list of 98000 domain names using Node.js?

Is there a way to determine if a domain is operating on the Shopify e-commerce platform? I have been searching extensively but haven't found a reliable method. I possess an array containing 98,000 domain names and I am interested in utilizing node.js ...

When I zoom in, a different div replaces the original div

I have recently delved into the world of HTML and CSS as I embarked on creating my own website. However, I seem to have hit a snag - when I zoom in on the content, it overlaps with the menu. I have scoured the internet for a solution to no avail, so any as ...

Modifying HTML code within a WebView (Monodroid) explained

WebView webView = FindViewById<WebView>(Resource.Id.webView1); webView.HorizontalScrollBarEnabled = false; webView.LoadUrl("res.htm"); I am looking for a way to modify certain parts of HTML code in my file and display it using webView without actual ...