Created
August 19, 2010 02:10
-
-
Save scottmessinger/536797 to your computer and use it in GitHub Desktop.
This file contains 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
$('.editable').live('mouseover mouseout', function(event) { | |
if (event.type == 'mouseover') { | |
function() { | |
$(this).children('.nubbin_wrapper').show(); | |
} | |
} else { | |
function() { | |
$(this).children('.nubbin_wrapper').hide(); | |
} | |
} | |
}); |
Originally, I did use hover, but I was reloading a div with ajax and thus needed to use .live(). Live doesn't work with hover--you have to use the two mouse events.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a typo above, I meant why check the event type if both paths are the same. But I see you are trying to toggle a div. You can actually bind "hover" to more than just links with jQuery, and
toggle()
can replace hide() and show(), this might be a more compact way to accomplish the same: