javascript - What webkit animations are available in Zepto.js - Stack Overflow

I'm investigating Zepto.js for a mobile project but not finding much documentation on the .anim ac

I'm investigating Zepto.js for a mobile project but not finding much documentation on the .anim action. I know it is webkit specific but which parts of the webkit animation css does it work with? For example, 3d transforms?

I'm investigating Zepto.js for a mobile project but not finding much documentation on the .anim action. I know it is webkit specific but which parts of the webkit animation css does it work with? For example, 3d transforms?

Share Improve this question asked Nov 19, 2010 at 10:44 handloomweaverhandloomweaver 5,0217 gold badges30 silver badges33 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

From the source you can see, that it uses -webkit-transform internally, so everything that is available with it can be used.

translate3d

$('div').anim({ translate3d: '10px, 20px, 30px'}, 2, 'ease-out');

Zepto.Fx

(function($){
  $.fn.anim = function(props, dur, ease){
    var transforms = [], opacity, k;
    for (k in props) 
        k === 'opacity' ? opacity=props[k] : transforms.push(k+'('+props[k]+')');
    return this.css({ '-webkit-transition': 'all '+(dur||0.5)+'s '+(ease||''),
      '-webkit-transform': transforms.join(' '), opacity: opacity });
  }
})(Zepto);

Zepto also supports the following CSS transform properties:

  • translate(X|Y|Z|3d)
  • rotate(X|Y|Z|3d)
  • scale(X|Y|Z)
  • matrix(3d)
  • perspective
  • skew(X|Y)

(http://zeptojs./#animate)

They seem to be prefixed like this:

vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' },

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745212691a4616937.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信