jQuery slider and jQuery lightbox not working together
I have a jquery slider and开发者_运维技巧 a jquery lightbox. I want both of them to work simultaneously in my site. But i am getting an error. So is there any way to do it?
http://www.highesthits.com/wp-content/uploads/2011/02/fbox.js
http://nivo.dev7studios.com/scripts/nivo-slider/jquery.nivo.slider.pack.js
Both jQuery and Lightbox use $.
To use both together without conflict, change the $ in jQuery to something else using the following code: (note that $jQ can be anything)
var $jQ = jQuery.noConflict();
Now, when writing your jQuery file use $jQ wherever you would normally use $
// 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
Here is what worked for me:
Plugins:
- jQuery Lightbox For Native Galleries
- Nivo Slider for WordPress
I made it work by removing line 32:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
from nivoslider4wp-shop.php located in the \plugins\nivo-slider-for-wordpress\
I hope that helps.
精彩评论