javascript - 从 jquery 中删除库的依赖项
问题描述
以前的开发人员已经包含了这样的 jquery -
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
在这个 jquery 中有一行作为
this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration)
所以在我的项目中添加了另一个js -jquery.easing.1.3.js
似乎这个 js 在悬停时会产生反弹效果,但我不确定。所以我已经注释掉了包含 easing.js 的代码。现在浏览器控制台抛出错误 -
jquery.min.js:4 Uncaught TypeError: f.easing[i.animatedProperties[this.prop]] is not a function
at fx.step (jquery.min.js:4)
at h (jquery.min.js:4)
at fx.custom (jquery.min.js:4)
at fx.show (jquery.min.js:4)
at HTMLDivElement.g (jquery.min.js:4)
at Function.dequeue (jquery.min.js:2)
at jquery.min.js:2
所以我的基本要求是在点击时显示/隐藏一个 div,而不是在 easing.js 完成的悬停时显示/隐藏一个 div。所以我想删除 easing.js 依赖。可能吗?
解决方案
推荐阅读
- javascript - 将 csv 文件转换为 javascript 对象
- c++ - 寻求帮助将 SOLID 原则应用于文件 I/O 问题
- jekyll - Jekyll:使用自定义导航时的上一个/下一个导航
- javascript - 有没有一种简单的方法可以将方法附加到实现可迭代协议的对象上?
- windows - 设置 2 控制台窗口标题时出现 Win32 内部错误“连接到系统的设备未运行”0x1F
- airflow - 气流:从 SQL 文件推送 XCOM
- python - 如何在圆形图中绘制社区网络
- azure - Azure devops 的错误日志中有错误
- c# - system.diagnostics wcf 跟踪不显示引发异常的服务端点
- node.js - 客户端如何知道服务器端的变化?