问题
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'
});
});
It does work, only it work once (when clicking the button of course). the second time i click its doing nothing. Thanx!!
回答1:
You can reset the CSS transform property in the callback:
http://jsfiddle.net/zA2ZQ/2/
$("#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', '');
});
});
来源:https://stackoverflow.com/questions/11579287/cannot-repeat-animation-jquery