Jquery 缓动对字体大小不起作用?
我想知道你们中是否有人经历过这种情况以及采用的解决方法(如果存在)。
当我在字体大小上正常使用 animate 时,效果非常好。但是,当我将缓动方程与动画函数一起使用时,我收到以下错误消息:
错误:f.easing[e.animatedProperties[this.prop]] 不是函数 源文件: https://192.168.1.218/jquery.js 行:18
以下是js代码我用过:
$(".myclass").animate({"font-size" : "16px"},"easeOutBounce",200);
I would like to know if any of you have experienced this and workarounds employed if they exist.
When i use animate normally on font-size it works perfectly. However, when i use easing equations along with the animate function i get the following error message :
Error: f.easing[e.animatedProperties[this.prop]] is not a function
Source File: https://192.168.1.218/jquery.js Line: 18
The following is the js code i have used :
$(".myclass").animate({"font-size" : "16px"},"easeOutBounce",200);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,如 animate() 的文档中所示,您必须在持续时间之后指定缓动参数,而不是之前:
但是,仅此并不能解决您的问题。
easeOutBounce
效果不是 jQuery 核心的一部分,您必须包含一个额外的插件,例如 jQuery Easing 或 jQuery UI 效果模块能够使用它。First, as indicated in the documentation for animate(), you have to specify the easing argument after the duration, not before:
However, that alone won't solve your problem. The
easeOutBounce
effect is not part of the jQuery core, you'll have to include an additional plugin like jQuery Easing or the jQuery UI effects module to be able to use it.我刚刚尝试过这个 - 我认为你的宽松论点是错误的。这对我有用
I've just tried this out - i think your easing argument is in the wrong place. This works for me