Created
October 11, 2012 21:54
-
-
Save rareyman/3875762 to your computer and use it in GitHub Desktop.
bxslider
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
//$('#slider1').bxSlider(); | |
// assign the slider to a variable | |
var slider = $('#slider1').bxSlider({ | |
controls: false | |
}); | |
// assign a click event to the external thumbnails | |
$('.thumbs a').click(function(){ | |
var thumbIndex = $('.thumbs a').index(this); | |
// call the "goToSlide" public function | |
slider.goToSlide(thumbIndex); | |
// remove all active classes | |
$('.thumbs a').removeClass('pager-active'); | |
// assisgn "pager-active" to clicked thumb | |
$(this).addClass('pager-active'); | |
// very important! you must kill the links default behavior | |
return false; | |
}); | |
// assign "pager-active" class to the first thumb | |
$('.thumbs a:first').addClass('pager-active'); | |
// $('#slider2').bxSlider(); | |
// assign the slider to a variable | |
var slider2 = $('#slider2').bxSlider({ | |
controls: false | |
}); | |
// assign a click event to the external thumbnails | |
$('.thumbs2 a').click(function(){ | |
var thumbIndex = $('.thumbs2 a').index(this); | |
// call the "goToSlide" public function | |
slider2.goToSlide(thumbIndex); | |
// remove all active classes | |
$('.thumbs2 a').removeClass('pager-active'); | |
// assisgn "pager-active" to clicked thumb | |
$(this).addClass('pager-active'); | |
// very important! you must kill the links default behavior | |
return false; | |
}); | |
// assign "pager-active" class to the first thumb | |
$('.thumbs2 a:first').addClass('pager-active'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment