我有一个jQuery的滑块和jQuery的灯箱。我希望他们两个在我的网站同时工作。但我得到一个错误。那么有没有办法做到这一点?jQuery滑块和jQuery灯箱不一起工作
http://www.highesthits.com/wp-content/uploads/2011/02/fbox.js
http://nivo.dev7studios.com/scripts/nivo-slider/jquery.nivo.slider.pack.js
我有一个jQuery的滑块和jQuery的灯箱。我希望他们两个在我的网站同时工作。但我得到一个错误。那么有没有办法做到这一点?jQuery滑块和jQuery灯箱不一起工作
http://www.highesthits.com/wp-content/uploads/2011/02/fbox.js
http://nivo.dev7studios.com/scripts/nivo-slider/jquery.nivo.slider.pack.js
两个jQuery和灯箱使用$。
互不冲突地同时使用两者,使用下面的代码在jQuery的改变$别的东西:(注意:$ JQ可以是任何东西)
var $jQ = jQuery.noConflict();
现在,写你的jQuery的文件使用时$ JQ无论你通常会使用$
// JavaScript Document
var $jQ = jQuery.noConflict();
$jQ(document).ready(function(){
//function on links <a>
$jQ("a").click(function(event){
//add a class to your html
//<p class="hideMe">
$jQ(".hideMe").hide("slow");
event.preventDefault();
});
});//end document ready function
这里是我工作:
插件:
我把它通过删除线32的工作:从位于\插件\ nivoslider4wp-shop.php
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
nivo-slider-for-wordpress \
我希望有帮助。
和你的源代码看起来像......? – JohnSmith 2011-04-04 07:54:25
请提供代码示例。 – Ant 2011-04-04 07:54:28
@JohnSmith @Ant我提供了js,它使用jquery并有冲突 – Raghavendra 2011-04-04 08:13:50