我想做一個有趣的函數來旋轉元素360.問題是它只執行第一次,我不知道爲什麼!jQuery上的動畫只執行一次
jQuery.fn.circularFun = function() {
this.stop().animate(
{rotation: 360},
{
duration: 500,
step: function(now, fx) {
$(this).css({"transform": "rotate("+now+"deg)"});
}
}
);
}
謝謝!!
你想讓它保持旋轉 –
讓你的函數調用自己遞歸 –
看看他的。 http://stackoverflow.com/questions/6767286/jquery-continuously-loop-animation –