0

我在“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()
            .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 上时,我再次看到了 alert('a')、alert('b') 和 alert('a') 但我刚刚通过了鼠标(所以我认为这只是一个事件)

我发生在谷歌浏览器和 Internet Explorer 中。有没有任何想法?

4

1 回答 1

0

alert()该问题仅在使用which 将焦点设置在警报框上时才会发生,从而导致mouseover事件多次触发。

当我更改alerttoconsole.log或其他操作时,它只会触发一次。

于 2011-03-09T06:23:09.613 回答