我不能用下面的例子重复动画(使用 jQuery Transit )
$("#rotateDiv2").button().click(function() {
$('#second').transition({
perspective: '100px',
easing: 'snap',
duration: '3000ms',
rotate3d: '1, 1, 0, 360deg'
});
});
它确实有效,但只有效一次(当然是在单击按钮时)。我第二次点击它什么都不做。谢谢!!
最佳答案
您可以在回调中重置 CSS 转换属性:
$("#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 - 不能重复动画 - jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11579287/