1
我想要'塊'效果和'按鈕旋轉'運行每點'clickMe'按鈕被點擊,但旋轉動畫只運行一次。爲什麼?爲什麼動畫只能使用一次,而其他效果可以根據需要每次點擊使用?
它應該只是一個簡單的jQuery演示有一個按鈕效果div,而該按鈕旋轉。我試圖避免我的問題,但我無法解決這個問題。試過Chrome和Firefox。先謝謝你。
$("#clickMe").click(function(){
// This happens with each click... as I wish for all the code!
$("#block1").fadeOut(2000);
$("#block1").delay(6000).slideDown(3000);
// This works only once, but I don't understand why.
$(this).animate(
{rotation: 360},
{duration: 1000,
step: function(now, fx){
$(this).css({"transform": "rotate(" + now + "deg)"});
}
});
});
**謝謝你**了這麼多,穆罕默德 - 優素福。當然,這個工作非常完美!我明白代碼現在是如何工作的,因此動畫需要重新設置爲零度纔有意義。偉大的修復! ;-) – JohnnyAce