Skip to content

Instantly share code, notes, and snippets.

@fanian
Created October 2, 2014 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanian/dde4aec79d2e16cf2b27 to your computer and use it in GitHub Desktop.
Save fanian/dde4aec79d2e16cf2b27 to your computer and use it in GitHub Desktop.
add css class to cycle slider item, when clicking
//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