2012-03-28 15 views
0

我有李箱,使這個jQuery的電話時,最終用戶對他們懸停,他光標:如何在jQuery中啓動.hover後鼠標仍在懸停?

$('.boxgrid.slidedown').hover(function(){ 
     $(".cover", this).stop().animate({top:'-150px'},{queue:false,duration:300}); 
     }, function() { 
      $(".cover", this).stop().animate({top:'4px'},{queue:false,duration:300}); 
     }); 

現在我要等待半秒用戶指向他的鼠標指針後,我就可以搪塞 的了slideDown影響。如果鼠標仍然懸停,那麼滑動將繼續,如果不是,則不會發生任何事情。

我嘗試使用settimeout()沒有任何運氣。謝謝。

+2

這也許可以幫助:http://cherne.net/brian/resources/jquery.hoverIntent.html – m90 2012-03-28 14:05:41

+0

還有另一個帖子里正在問類似的問題 http://stackoverflow.com/questions/1273566/how-do-i-check-if-the-mouse-is-over-an-element-in-jquery – Namat 2012-03-28 14:08:38

回答

相關問題