2011-02-17 60 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或其他操作時,它只會觸發一次。