使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法

2023-05-25,,

在使用zepto时,我先引入zepto.min.js,然后引入fx.js,但是在使用animate函数时,控制台却报如下错误:

Uncaught TypeError: this.bind is not a function

解决办法

1、去github中打开src/fx.js,打开链接,把内容添加到zepto.min.js中,问题就解决了。然后需要什么模块就向zepto.min.js中添加该模块的内容,最后只用引入zepto.min.js。

2、zepto的定制:

(1)安装nodejs环境

(2)下载zepto.js并解压

(3)cmd命令行进入解压缩后的目录,执行npm install命令,安装node工具

(4)打开解压后的zepto文件下的make文件,找到target.build 部分,添加需要的模块并保存

(5)cmd执行npm run-script dist,此时zepto目录下会生成一个dist文件,引入dist文件下的zepto.min.js

使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法的相关教程结束。

《使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法.doc》

下载本文的Word格式文档,以方便收藏与打印。