jquery 缓动破坏了 WordPress 上的 jquery
当我将 jquery easing 1.3 插件添加到我的页面时,我收到错误,我什至还没有使用自定义缓动,但只是加载它就会停止动画元素的工作。我不是 jquery 专家,所以我真的不知道如何调试它,但我相当确定存在冲突,这是错误:
Uncaught TypeError: Property 'undefined' of object #<Object> is not a function
当您滚动动画元素时会触发错误,这是我正在处理的页面:
http://www.pegbarandgrill.com/blog/
如果您将鼠标悬停在链接上,目录中,您应该会看到一个动画菜单打开,但此时您会收到错误消息。我使用以下几行获取了 jquery 和 easing
<script type="text/javascript" src="/wp-content/themes/pegbarAndGrill_01/script/jquery.js"></script>
<script type="text/javascript" src="/wp-content/themes/pegbarAndGrill_01/script/easing.js"></script>
另外,如果我删除 wp_head() 和 wp_footer() 函数,冲突就会消失。知道可能是什么问题吗?
非常感谢
Im getting an error when i add the jquery easing 1.3 plugin to my page, i havent even used custom easing yet but just loading it stops animated elements working. Im not a jquery expert so i dont really know how to debug it but im fairly sure that there is a conflict, heres the error:
Uncaught TypeError: Property 'undefined' of object #<Object> is not a function
The error is triggered when you roll over the animated elements, heres the page im working on:
http://www.pegbarandgrill.com/blog/
if you roll over the links & directory you should see an animated menu open but this is when you will get the error. I sourced jquery and easing with the following lines
<script type="text/javascript" src="/wp-content/themes/pegbarAndGrill_01/script/jquery.js"></script>
<script type="text/javascript" src="/wp-content/themes/pegbarAndGrill_01/script/easing.js"></script>
Also if i remove the wp_head() and wp_footer() functions the conflict goes away. Any idea what the problem might be?
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试用它来包装 easing.js 文件的内容,
它之前节省了我的时间!
Try to wrap contents of easing.js file with
It saved my time before!
我收到了同样的错误消息。我有 jQuery、jQuery UI、缓动插件,以及对 jQuery.noConflict() 的调用,但顺序错误。
很久以前我一直在使用 jQuery.noConflict() 来解决其他一些问题,但我不再需要它,所以我删除了它。
然后,我按以下顺序放置
元素:
这解决了问题。
I got the same error message. I had jQuery, jQuery UI, the easing plugin, and a call to
jQuery.noConflict()
in the wrong order.I had been using
jQuery.noConflict()
to get around some other problem from a long time ago, but I no longer needed that so I removed it.I then put the
<script>
elements in this order:This fixed the problem.