I have the following mouse shooting script and the mouse is always twice! what do you suggest me to do wrong (cancel, return, for example)? I tried a few things, but nothing helped.
here is the code:
$('#container').delegate('div.showmenu', 'mouseover mouseenter mouseout mouseleave', function(e){
if (e.type === 'mouseover' || e.type==='mouseenter') {
if($(this).parents().closest('div').hasClass('whatever')){
alert(e.type);
menu.show();
foldercmenu.hover(
function(){
$(this).show();
},
function(){
$(this).hide();
}
);
}else {
}
}else if(e.type==='mouseout' || e.type==='mouseleave'){
alert(e.type);
menu.hide();
$(this).unbind('mouseover mouseenter mouseout mouseleave');
}
});
source
share