admin管理员组文章数量:1415420
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 badges2 Answers
Reset to default 6From 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' },
本文标签: javascriptWhat webkit animations are available in ZeptojsStack Overflow
版权声明:本文标题:javascript - What webkit animations are available in Zepto.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745212690a2647982.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论