解决Zepto.js不支持animate报错的问题,错误信息$(...).animate is not a function

来源:互联网 发布:能以礼让为国乎 编辑:程序博客网 时间:2024/05/21 09:29

这次移动端web项目的开发用到Zepto.js,其中一个列表项要求实现左滑删除的功能,我用到animate,但是一直报错:

后来查询发现zepto.min.js默认只是加载一部分模块,其中就没有animate的模块;

解决办法:

在github中 https://github.com/madrobby/zepto,找到fx.js文件,把内容追加到zepto.min.js中,

或者单独建一个animate.js文件引入到项目中,即可!


原创粉丝点击