多个jquery不能一起工作 [英] multiple jquery not working together
本文介绍了多个jquery不能一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在网上购物商城网站工作。
在此我在onmouseover和第二个滑块图片上使用了两种类型的jquery第一缩放产品。
但两个jquery都不合作。他们一次只工作一次。
我正在使用以下js。
hello,
I am working on a online shopping mall website.
In this I using two type of jquery first zoom product on onmouseover and second slider image.
But both jquery don''t working together. they work only single at a time.
I am using following js.
<script src="a/all.js" type="text/javascript"></script>
<script type="text/javascript" src="a_data/jquery.js"></script>
我如何一次使用两个j。
How can I use both js at a time.
推荐答案
由于与两个jquery文件冲突,似乎发生了这个问题。
有几种方法可以解决这个问题。
一种方法是使用jQuery.noConflict()
方法。 />
http://api.jquery.com/jQuery.noConflict/ [ ^ ]
你也可以通过使用完整的jquery别名来避免这种情况
http://stackoverflow.com/questions/5203955/conflict-with-2-javascript-files [ ^ ]
It seems this issue occurred due to the conflict with two jquery file.
There are several way to overcome this.
One way is usingjQuery.noConflict()
method.
http://api.jquery.com/jQuery.noConflict/[^]
Also you avoid this by using the full jquery alias
http://stackoverflow.com/questions/5203955/conflict-with-2-javascript-files[^]
这篇关于多个jquery不能一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文