Skip to content

Instantly share code, notes, and snippets.

@spacegauch0
Last active December 21, 2015 20:19
Show Gist options
  • Select an option

  • Save spacegauch0/6360676 to your computer and use it in GitHub Desktop.

Select an option

Save spacegauch0/6360676 to your computer and use it in GitHub Desktop.
// init and stop the inner slideshows
var inners = $('.gallery-project .gallery-images').cycle().cycle('stop');
var slideshow = $('#slideshow').cycle({
fx: 'fade',
speed: 300,
timeout: 0,
prev: '#prev',
next: '#next',
before: function() {
// stop all inner slideshows
inners.cycle('stop');
// start the new slide's slideshow
$(this).find('.gallery-images').cycle({
fx: 'fade',
timeout: 2000,
pager: $(this).find('.slidesjs-pagination'),
autostop: true,
end: function() {
// when inner slideshow ends, advance the outer slideshow
slideshow.cycle('next');
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment