Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7046015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:36:01+00:00 2026-05-28T02:36:01+00:00

I have a jQuery effect where if the user mouse over the reply image,

  • 0

I have a jQuery effect where if the user mouse over the reply image, the image would change to another image. The problem I am having is that when you mouse over another object, which is set to addClass() for the reply image, this new reply image does not change its image when mouseovered.

Demo of my problem:
http://www.sfu.ca/~jca41/stuph/jQueryTest/jQueryTest.html

$(document).ready(function(){

    $(".red").mouseover(function() {
        $(this).css("color","red");
        $(this).addClass("reply");
    });
    $(".red").mouseout(function() {
        $(this).css("color","black");
        $(this).removeClass("reply");
    });

    $(".reply").mouseover(function() {
        $(this).css("background-image", "url(reply_h.png)"); 
    });
    $(".reply").mouseout(function() {
        $(this).css("background-image", "url(reply.png)"); 
    });

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:36:01+00:00Added an answer on May 28, 2026 at 2:36 am

    The “new” reply image is part of a CSS background. Therefore it’s not actually part of the DOM, and therefore jQuery can’t modify it or even detect when it’s moused over.

    To get the result you want, you need to make the second button part of the DOM and hide/show it instead: http://jsfiddle.net/mblase75/tJwUW/3/

    HTML:

    Mouseover the reply image and it changes states
    <div class="reply"></div>
    
    <hr><hr><hr>
    
    <div class="red">
    <div class="reply"></div> <!-- added -->
    Mouseover this, then mouseover the new reply image 
    and notice it does not change state
    </div>
    

    CSS:

    .reply {
        background-image:url('reply.png');
        height: 18px;
        background-repeat: no-repeat;
    }
    .red .reply { /* added */
        visibility: hidden;
    }
    

    JS:

    $(".red").mouseover(function() { // modified
        $(this).css("color", "red").find(".reply").css('visibility','visible');
    });
    $(".red").mouseout(function() { // modified
        $(this).css("color", "black").find("reply").css('visibility','hidden');
    });
    
    $(".reply").mouseover(function() {
        $(this).css("background-image", "url(reply_h.png)"); 
    });
    $(".reply").mouseout(function() {
        $(this).css("background-image", "url(reply.png)"); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two sortable lists, one being nested, with a mouse over effect on
I would like to use the jquery slideUp effect when the user navigates away
I have used jquery to create a simple slideup/down effect when user clicks on
i have a client side jquery script that logs the user off after 5
I have an image link. When the user hovers over the image, an info
I have created a simple JQuery script with hovering effect on some links. The
I have jQuery to select all font elements that are children of the element
Problem I'm trying to do an effect where a pop-up appears when the user
Currently I have a JQuery script in place http://jsfiddle.net/gaby/zzj7E/5/ which handles the requirement that
I was looking the Highlight effect of jQuery's. That effect is really the one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.