2D and 3D transforms as regular CSS properties you can set using.css() and animate using .animate()
.css()
.animate()
示例代码;
$(document).ready(function() { $(‘#forward’).click(function() { $(‘#test’).animate({ translateX:’-=150’, translateY:’+=150’, scale:’+=2’, rotateY: ‘+=’+(2*Math.PI), rotateX: ‘+=’+Math.PI, rotateZ: ‘+=’+Math.PI },1500); });
$(‘#backward’).click(function() { $(‘#test’).animate({ translateX:’+=150’, translateY:’-=150’, scale:’-=2’, rotateY: ‘-=’+(2*Math.PI), rotateX: ‘-=’+Math.PI, rotateZ: ‘-=’+Math.PI },1500); }) });