Skip to content

Instantly share code, notes, and snippets.

@wplit
Created April 16, 2021 08:29
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 wplit/42fc0d8af3ccb936fb69d18653425469 to your computer and use it in GitHub Desktop.
Save wplit/42fc0d8af3ccb936fb69d18653425469 to your computer and use it in GitHub Desktop.
click to go to specific cell (add to button/link directly, advanced > javascript)
jQuery(document).ready(function($) {
let carouselSelector = '.my-carousel'; /* Change to your carousel class */
let index = 3; /* Change to needed cell index */
$('#%%ELEMENT_ID%%').on('click', function(e) {
e.preventDefault()
$(carouselSelector).find($(carouselSelector).children().data('carousel')).flickity( 'select', index, false, true );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment