我有一個問題,我有這樣的代碼:如何使事件等待,直到jQuery的翻頁效果結束?
$(document).ready(function(){
/* The following code is executed once the DOM is loaded */
$('.clsks').mouseenter(function() {
var ob = $(this);
var dar = $(this).attr('ids');
var obj1 = $('#sponsorFlip'+dar);
var obj2 = $('#sponsorData'+dar);
obj1.flip({
direction:'lr',
speed: 350,
onBefore: function(){
// Insert the contents of the .sponsorData div (hidden from view with display:none)
// into the clicked .sponsorFlip div before the flipping animation starts:
obj1.html(obj2.html());
}
});
// Setting the flag:
//obj1.data('flipped',true);
}).mouseleave(function() { var dar = $(this).attr('ids');
var obj1 = $('#sponsorFlip'+dar); obj1.revertFlip(); });
});
我需要做的事件MouseEnter等到這個jQuery的翻轉完成的Cuz有時候如果有人的mouseenter快速的鼠標離開失敗的Cuz「obj1.html(obj2.html( ));」超過它。
但我只需要做出MouseEnter事件等待jQuery的翻轉完成。
您無法在mouseenter上啓動翻轉,但需要等待翻轉完成。這沒有任何意義。當你得到mouseenter事件時,它已經發生了。翻轉完成後你想做什麼操作?或者,你試圖解決的真正問題是什麼。 – jfriend00 2012-01-07 03:29:15