Created
March 4, 2009 03:37
-
-
Save chuyeow/73697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Show popup when user hovers over a child element of a container div. | |
$('div.child', '#container').mouseover(function() { | |
$('#popup').show(); | |
}); | |
// But hide it only when the mouse pointer leaves the container. Mouseout doesn't | |
// work here because of event bubbling - it'll trigger on child elements of | |
// #container as well. | |
$('#container').bind('mouseleave', function() { | |
$('#popup').hide(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment