UPDATE: I've found that the jquery.bxslider plugin itself clones and appends/prepends the LIs causing the trouble. No solution to this though, except maybe using another script :(
I'm having to jQuery plugins partially conflicting with each other, Boxslider (an image slider) and Colorbox (a lightbox). They both work, but the slider script somehow ads to the lightbox so the first and last images get repeated twice.
This is easier to understand if you have a look at the example page.
You'll see there are 3 images in the slider, but when opening the lightbox it gives you 5 images.
I've tried my luck with noconflict()
, but that just stopped anything from working at all. After some searching I'm assuming there are some namespacing issues, though I have no idea where or how to debug this.
The scripts I'm using are
<link type="text/css" media="screen" rel="stylesheet" href="assets/css/colorbox.css" />
<script type="text/javascript" src="assets/js/jquery.bxslider2.0.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#gallery').bxSlider({
auto: true,
wrapper_class: 'gallery-holder',
auto: false,
speed: 100,
pager: true,
next_text: 'next',
prev_text: 'back'
});
});
</script>
<script type="text/javascript" src="assets/js/jquery.colorbox-min.js"></script>
<script type="text/javascript">
$(window).load(function(){
$("#gallery a[rel='group']").colorbox({maxWidth:"80%", maxHeight:"80%", scalePhotos: true});
});
</script>
I've tried swapping the order around, which only made one or both stop working. I've wasted to much time trying to nail this down, so any help would be much appreciated!