我想做一个有趣的函数来旋转元素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 –