2011-02-17 53 views
0

我对“http://dev.moragues.pe/austral/es/#/nosotros/organizacion/gerencia/”我已经注册了两个事件意想不到的onmouseout

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'),但我只是通过了鼠标(所以我认为这只是一个事件)

我发生在谷歌浏览器和Internet Explorer中。 Anyboy有什么想法吗?

+0

您发布的链接似乎链接Wordpress安装页面。我建议亲自编辑。 – 2011-02-17 14:28:59

回答

0

只有在使用alert()时才会出现问题,该问题将焦点设置在警告框上,导致mouseover事件触发多次。

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