问题
Can anybody help me with this jquery function. I know it is a conflict with both, but i dont know what i must change.
It works both allown on the page. But toghter the lightbox doesn´t work.
Lightbox
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
Nivo slider
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="slider/jquery.nivo.slider.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect:'fade',
slices:10,
animSpeed:1500,
pauseTime:10000,
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3...
keyboardNav:true, //Use left & right arrows
pauseOnHover:true, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.8, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){} //Triggers after all slides have been shown
});
});
</script>
回答1:
Try this:
<script type="text/javascript">
var j = jQuery.noConflict();
j(window).load(function() {
j('#slider').nivoSlider({
回答2:
just to say I had the same problem.
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.
来源:https://stackoverflow.com/questions/15681198/nivo-slider-and-lightbox-conflict-jquery