TransformJS3D和2D转换的jQuery插件

联合创作 · 2023-10-02 16:49

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);
})
});

 

浏览 7
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报