jquery动画变换:旋转

时间:2013-09-30 11:17:59

标签: jquery animation rotation

我有以下图像,我试图为旋转设置动画:

enter image description here

我目前用于图片的css就是这个(图片有一个“p5easy”类:

.p5easy{ 
   transform:rotate(-90deg);
   -ms-transform:rotate(-90deg); /* IE 9 */
   -webkit-transform:rotate(-90deg); /* Safari and Chrome */
}

然后我使用jQuery尝试动画图像。我正在做以下事情:

$('.p5easy').delay(0).show().animate({'-webkit-transform':'rotate(0deg)'},{duration: 1000});    

我不太确定,但这不起作用。我是以正确的方式接近这个吗? jQuery动画支持旋转,还是我需要另一个插件?

这是一个小提琴http://jsfiddle.net/jvpEN/

2 个答案:

答案 0 :(得分:1)

试试这个

$('.p5easy').animate({  textIndent: 0 }, {
    step: function(now,fx) {
      $(this).css('-webkit-transform','rotate('+now+'deg)'); 
    },
    duration:'slow'
},'linear');

答案 1 :(得分:0)

我可能有点(一年)迟到了,但你可以试试以下其中一种: http://www.jqueryrain.com/2012/08/jquery-flip-effect-plugin-examples/

相关问题