0
效果搖我有jQuery代碼:jQuery的.stop()不工作的懸停
setInterval(function() {
var grayarrow = jQuery("ul#dropdowngray").parent();
var greenarrow = jQuery("ul#dropdown").parent();
grayarrow.effect('shake', { times:2 }, 100);
greenarrow.effect('shake', { times:3 }, 200);
jQuery("ul#dropdowngray").parent().hover(
function(){ grayarrow.stop().effect('shake', { times:0 }, 100); },
function(){ grayarrow.stop().effect('shake', { times:2 }, 100); }
);
jQuery("ul#dropdown").parent().hover(
function(){ greenarrow.stop().effect('shake', { times:0 }, 100); },
function(){ greenarrow.stop().effect('shake', { times:2 }, 100); }
);
}, 5000);
然而,當我將鼠標懸停在該元素,晃動繼續執行。我本來代碼:
jQuery("ul#dropdowngray").parent().hover(
function(){ grayarrow.stop(); },
function(){ grayarrow.stop(); }
);
,但因爲這是不工作要麼,我實現瞭解決這裏討論:jquery .stop() not working
我怎樣纔能有效地使晃動停止,當鼠標在顫抖元素?
謝謝
給我留下了深刻的印象。它工作得很好。謝謝 – IberoMedia