Created
October 2, 2014 10:31
-
-
Save fanian/dde4aec79d2e16cf2b27 to your computer and use it in GitHub Desktop.
add css class to cycle slider item, when clicking
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
//add css class to cycle slider item, when clicking | |
jQuery(document).ready(function($){ | |
$('.slider .cycle-slide').click(function(){ | |
var index = $('.slider').data('cycle.API').getSlideIndex(this); | |
$('.cycle-slide-active').removeClass('cycle-slide-active'); | |
$(this).addClass('cycle-slide-active'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment