【发布时间】:2013-08-08 13:01:09
【问题描述】:
大家好,我在我的 wordpress 站点中为通知栏制作了缓动效果,但是每当我单击按钮时,我都会收到 TypeError 错误。 TypeError: v.easing[this.easing] 不是函数 这是我现在使用的脚本
<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>
在以前我这样调用脚本
<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>
这是我所面对的截图。
任何建议都会很棒。 我提供直播link
【问题讨论】:
-
就像它说的那样,v.easing[this.easing] 不是一个函数,
alert(typeof v.easing[this.easing])和alert(this.Easing)(或 console.log 而不是 alert)。 -
也许应该是
$.easing或jQuery.easing。 -
我从 wordpress 的 wp-includes 加载 jquery 库。
-
您的网页中有两个版本的 jQuery
-
@vicky 它们是一样的,但你应该只包含它一次。第二个 jQuery
<script>覆盖了第一个 jQuery 和 jQuery UI<script>所做的一切。这就是你失去 jQuery UI 的缓动扩展的原因。
标签: javascript jquery wordpress jquery-ui