javascript 类型错误:v.easing[this.easing] 不是函数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18126749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 10:48:47  来源:igfitidea点击:

TypeError: v.easing[this.easing] is not a function

javascriptjquerywordpressjquery-ui

提问by Vignesh Pichamani

Hi all I make the easing effect for the notification bar in my wordpress Site but whenever i click the button i get the error as TypeError. TypeError: v.easing[this.easing] is not a function Here is the script i using now

大家好,我在我的 wordpress 站点中为通知栏制作了缓动效果,但是每当我单击按钮时,我都会收到 TypeError 错误。TypeError: v.easing[this.easing] is not a function 这是我现在使用的脚本

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

In Previously i called the script as like this

在以前我这样称呼脚本

 <script src="<?php echo site_url(); ?>/wp-includes/js/jquery/jquery.js"></script>
 <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

Here is the Screenshot What i face exactly. enter image description here

这是我所面对的截图。 在此处输入图片说明

Any suggestion would be great. I Provide the live link

任何建议都会很棒。我提供实时链接

回答by Moazzam Khan

You have two copy of jQuery file in your webpage, remove one inclusion, it would start working. I checked it in my system.

您的网页中有两个 jQuery 文件副本,删除一个包含项,它将开始工作。我在我的系统中检查了它。

Removing line number 200 -

删除行号 200 -

script type='text/javascript' src='http://techstumbling.com/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>

would work.

会工作。

Explained-

解释——

You have included jQuery file in the following order -

您已按以下顺序包含 jQuery 文件 -

  • jQuery - created $ and added few properties to $
  • jQuery Ui - added more properties to $
  • jQuery - created $ and overridden the jQuery UI specific properties in $
  • jQuery - 创建 $ 并向 $ 添加一些属性
  • jQuery Ui - 向 $ 添加更多属性
  • jQuery - 创建 $ 并覆盖 $ 中的 jQuery UI 特定属性

回答by Dwza

According to the accepted answere of @Moazzam Khan. I had the same issue using jQuery 1.8.3but I was pretty sure that I have included jQuery only once. After trying around I found out that I have to include jQuery-UI as well. Than the issue disappeard. Hope this helps people who experienced the same probpem like I did.

根据@Moazzam Khan的公认回答。我在使用jQuery 1.8.3 时遇到了同样的问题,但我很确定我只包含了一次 jQuery。在尝试之后,我发现我还必须包含 jQuery-UI。比问题消失了。希望这可以帮助像我一样经历过同样问题的人。

回答by Guy Ytzhak

the problem is because the easing effect named was changes after version 1.9 of jQuery.

问题是因为在 jQuery 1.9 版本之后命名的缓动效果发生了变化。

Link to the solution: Solution

链接到解决方案: 解决方案

this is the list of all new easing and theirs names: http://api.jqueryui.com/easings/

这是所有新缓动及其名称的列表:http: //api.jqueryui.com/easings/

回答by Okazari

I think the big problem is pointed out, you include two time JQuery. But it's not a big big problem itself.

我认为指出了大问题,您包括两次 JQuery。但这本身并不是什么大问题。

The bigest problem is that you have an include of JQuery AFTERincluding JQuery-UI.

最大的问题是您在包含 JQuery-UI之后包含了 JQuery。

There's a high probability that the inclusion of JQuery unset some things that Jquery-ui set when your include it. It may explain why your animation option is not found.

包含 JQuery 很可能会取消设置 Jquery-ui 在您包含它时设置的某些内容。它可以解释为什么找不到您的动画选项。