Created
September 25, 2014 14:32
-
-
Save amenk/a59b560c179243ca5c70 to your computer and use it in GitHub Desktop.
Connected BXSliders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connected sliders | |
sliders = []; | |
$('.bxslider-detail').each(function() { | |
sliders[$(this).attr('data-id')] = $(this).bxSlider({ | |
mode: 'horizontal', | |
speed: 1000, | |
slideWidth: 400, | |
auto: true, | |
pager: false, | |
infiniteLoop: true | |
}); | |
}); | |
$(".bxslider-thumbs").each(function () { | |
if ($(this).find("li").length > 3) { | |
$(this).bxSlider({ | |
minSlides: 3, | |
maxSlides: 3, | |
slideWidth: 390, | |
slideMargin: 12, | |
moveSlides: 1, | |
pager: false, | |
auto: false, | |
infiniteLoop: false, | |
hideControlOnEnd: true, | |
nextText: '<span></span>', | |
prevText: '<span></span>' | |
}); | |
} | |
}); | |
$(".bxslider-thumbs li").on("click", "a", function (event) { | |
event.preventDefault(); | |
var newIndex = $(this).attr("data-slide-index"); | |
parentSliderId = $(this).parents("ul").attr("data-parent-id"); | |
parentSlider = $('#' + parentSliderId); | |
sliders[parentSliderId].goToSlide(newIndex); | |
}); | |
// end connected sliders |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment