开发者

JS mouseover/mouseout blinking but not staying

开发者 https://www.devze.com 2023-03-21 04:47 出处:网络
Here\'s a little code I have problem with: $(\".setEtiquette\").mouseover(function(){ var rightFrame = $(this).attr(\"name\");

Here's a little code I have problem with:

$(".setEtiquette").mouseover(function(){
    var rightFrame = $(this).attr("name");
    $('#'+rightFrame).fadeIn();
}).mouseout(function(){
    var rightFrame = $(this).attr("name");
    $('#'+rightFrame).fadeOut();
});

When on the setEtiquette, the rightFrame is blinking but that开发者_如何学Python's not what we want it here, we want it stay and leave when moving to another etiquette...

Do you have anything that would help me?

Thanks!


mouseover() fires when the pointer moves into the children elements as well, while mouseenter() fires only when the pointer moves into the bound element. You may want to try mouseenter/mouseleave instead of mouseover/mouseout, if the blinking is due to existing children of the elements you are binding to.

0

精彩评论

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