簡單的問題,如何運行此jQuery反彈懸停在總是反彈下方。所以我不需要徘徊,每次都會彈跳。每次運行jQuery函數(在彈跳效果的情況下)
下面是代碼:
$(document).ready(function(){
$(".button").hover(function(){
$(".button img")
.animate({top:"-10px"}, 200).animate({top:"-4px"}, 200) // first jump
.animate({top:"-7px"}, 100).animate({top:"-4px"}, 100) // second jump
.animate({top:"-6px"}, 100).animate({top:"-4px"}, 100); // the last jump
});
});
使用'setInterval'定期運行的功能。 – Barmar 2014-08-29 01:55:40