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

  • Home
  • SEARCH
  • 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 8617383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:50:37+00:00 2026-06-12T05:50:37+00:00

I have some divs that are created with data from a json string. Most

  • 0

I have some divs that are created with data from a json string. Most of them are images. Over those dynamic loaded images and want to show a div when mouse over it and hide when you mouse out. Therefore I used the live function, found it here on the forum.
The mouse over function works but it won’t mouse out. So when I hover one image the div shows up but when I mouse out the div is still visible. Any suggestions on this?

My code

<script type="text/javascript">
    $('.product').live("hover", function() {
        $(this).find('.product').stop(false,true); // get the image where hovering
        $(this).find('div.caption').stop(false,true).fadeIn(100); // and fade in
    },
     function() {
        $(this).find('.product').stop(false,true); // on mouse leave hide it  
        $(this).find('div.caption').stop(false,true).fadeOut(100); // fade out
     });
</script>

UPDATED ANSWER
Thanks to the help below I found the solution.

$(".productsGrid .product").live("mouseenter", function() {$(this).find('.product').stop(false,true);
$(this).find('div.caption').stop(false,true).fadeIn(100);})
$(".productsGrid .product").live("mouseleave", function() { $(this).find('.product').stop(false,true);   
$(this).find('div.caption').stop(false,true).fadeOut(100);});
  • 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-06-12T05:50:39+00:00Added an answer on June 12, 2026 at 5:50 am

    The issue is that live only takes one function parameter, not 2 in the way that the hover function does. Using hover with live basically just binds the one function to both mouseenter and mouseleave.

    You can see an explanation and solution here.

    However, unless you are using a version of jquery prior to 1.7, you should not be using live as it is deprecated. You should instead use on.

    Your code would look something like this:

    $(STATIC ANCESTOR).on({ 
            mouseenter: 
               function() 
               { 
    
               }, 
            mouseleave: 
               function() 
               { 
    
               } 
           }, ".product"
        ); 
    

    Where STATIC ANCESTOR is replaced with an ancestor element of your .product elements which is not dynamically loaded. If needed document can be used but should only be used as a last resort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some divs that have dynamic heights controlled by a 'click' function as
I have some divs that have dynamic heights controlled by a 'click' function as
i have a script that creates divs with some background image then moves them,
I'm trying to hide some divs that I have created dynamically using the .hide()
I have some DIVs that I am using JQuery to hide and show using
I have some icons inside divs and needed to lay them out with a
I have some divs that I want to display under some specific conditions in
I have some divs created dynamically this way: //here goes some loop, and everything
I have a created divs on a row and now when I zoom them,
I have some data wrapped in 3 divs, each div represents a 'tab', and

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.