10 09/2014

jquery transform animate

最后更新: Wed Sep 10 2014 12:37:50 GMT+0800

jquery animate default can not animate the transform:rotate(90deg).So you want to write the step function yourself.

$('#abc').animate(
    {rotate:80},
    {
      step:function(now,tween){
        if (tween.prop === "rotate"){
          $(this).css('transform','rotate('+now+'deg)');
        }
    }
  },
  500)