Jquery 出人意料的
我在街上有个画廊http://dev.moragues.pe/austral/es//nosotros/organizacion/gerencia/ 我登记了两项活动Jquery 出人意料的,jquery,mouseover,mouseout,Jquery,Mouseover,Mouseout,我在街上有个画廊http://dev.moragues.pe/austral/es//nosotros/organizacion/gerencia/ 我登记了两项活动 jQuery('.ngg-gallery-thumbnail a img') .live('mouseover',function() { alert('a'); jQuery(this).css('zIndex','100').addClass("hover").stop(
jQuery('.ngg-gallery-thumbnail a img')
.live('mouseover',function() {
alert('a');
jQuery(this).css('zIndex','100').addClass("hover").stop()
.animate({
top: '0',
left: '0',
width: '415px',
height: '315px'
}, 600);
})
.live('mouseout',function(){
alert('b');
it = jQuery(this).attr('initialTop');
il = jQuery(this).attr('initialLeft');
jQuery(this).removeClass("hover").stop()
.animate({
top: it,
left: il,
width: '105px',
height: '80px'
}, 600,function(){
jQuery(this).css('zIndex','0').addClass("hover").stop()
});
});
但当我把鼠标放在div上时,我又看到了警报'a',警报'b'和警报'a',但我刚刚通过了鼠标,所以我认为这只是一个事件
我在谷歌chrome和Internet explorer中看到过。有男孩知道吗?只有在使用alert时才会发生此问题,alert将焦点设置在alert框上,从而导致mouseover事件多次触发
当我将警报更改为console.log或其他操作时,它只触发一次。您发布的链接似乎链接到Wordpress安装页面。就我个人而言,我建议你修改一下。呃,我不介意,我只是有点担心你网站的安全性。。。