创建一个不同的别名,而不是jQuery在脚本的其余部分使用。
var j = jQuery.noConflict();
做一些与jQuery(使用ALISE j的,而不是$进入你的脚本是冲突)
j("div p").hide();
不要与其他库的$()
东西
$(“content”).style.display =“none”;
============================================== =================================== 其他例子
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="jquery.superautocomplete.js"></script> <!-- this uses 1.9.1 -->
</head>
<body>
<div id="log">
<h3>Before $.noConflict(true)</h3>
</div>
<script src="http://code.jquery.com/jquery-1.3.2.js"></script>
<script src="jquery.fancybox.js"></script> <!-- this uses 1.3.2 -->
<script>
/*
Restore globally scoped jQuery variables to the first version loaded
(the newer version)
*/
jq132 = jQuery.noConflict(true);
jq132("[rel=fancybox]").fancybox(); // using 1.3.2
$("#autocomplete").superautocomplete(); // using 1.9.1
</script>
</body>
</html>
Referrence from here
任何使用超过jquery 2versions的原因 – LarsEngeln
我不知道,我没有制作整个网站。导航栏是3.8我认为和我在一个单页上做了1.8像。我不知道为什么,我真的很新jquery – thommylue
删除第二个jquery include ..哪个文件处理您的导航的js? – flauntster