不能重复动画 - jQuery [英] cannot repeat animation - jQuery
本文介绍了不能重复动画 - jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法使用以下示例重复动画(使用 jQuery Transit )
I can't repeat animation with the following example (using jQuery Transit)
$("#rotateDiv2").button().click(function() {
$('#second').transition({
perspective: '100px',
easing: 'snap',
duration: '3000ms',
rotate3d: '1, 1, 0, 360deg'
});
});
它工作,只有它工作一次(当然点击按钮)。第二次我点击它什么也不做。 Thanx !!
It does work, only it work once (when clicking the button of course). the second time i click its doing nothing. Thanx!!
推荐答案
您可以在回调中重置CSS transform属性:
You can reset the CSS transform property in the callback:
$("#rotateDiv2").button().click(function() {
$('#second').transition({
perspective: '100px',
easing: 'snap',
duration: '3000ms',
rotate3d: '1, 1, 0, 360deg'
}, function(){
//reset the transform property
$(this).css('transform', '');
});
});
这篇关于不能重复动画 - jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文