3D和2D转换的jQuery插件 TransformJS
本文导语: 2D and 3D transforms as regular CSS properties you can set using .css() and animate using .animate() 示例代码; $(document).ready(function() {$('#forward').click(function() { $('#test').animate({ translateX:'-=150', translateY:'+=150', scale:'+=2', rotateY: '+='+(2*M...
2D and 3D transforms as regular CSS properties you can set using .css() and animate using .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);
})
});