Live mouseover event
I am trying to show an anchor link when a div is hovered. This is working fine, but when I hover over the link itself, it flashes, when it should just stay. I tried a regular hover function on the anchor link and that didn't work... This is my js:
$('.div_mayKnowUser').live("mouseover", function(){ $(this).find('.a_ignoreUser').fadeIn(); }); $('.div_mayKnowUser').live("mouseout", function(){ $(this).find('.a_ignoreUser').fadeOut(); });
and my HTML:
<div class="div_mayKnowUser">
<a href="" c开发者_C百科lass="a_ignoreUser">a link</a>
</div>
"mouseover" => "mouseenter"
"mouseout" => "mouseleave"
worth a read => http://www.quirksmode.org/js/events_mouse.html
Edit: regarding live and mouseenter/mouseleave, it seems there's a known bug that hasn't been fixed, see the examples on the comments.
精彩评论