Search code examples
javascriptjquerymouseovermouseout

JS mouseover/mouseout blinking but not staying


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'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!


Solution

  • 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.