开发者

Live mouseover event

开发者 https://www.devze.com 2023-03-12 10:06 出处:网络
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 ancho

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消