Skip to content

Instantly share code, notes, and snippets.

@phillcoxon
Last active December 31, 2015 18:22
Show Gist options
  • Select an option

  • Save phillcoxon/8026056 to your computer and use it in GitHub Desktop.

Select an option

Save phillcoxon/8026056 to your computer and use it in GitHub Desktop.
Slidesjs.com - stopping the slider.
<!-- SlidesJS Required: Initialize SlidesJS with a jQuery doc ready -->
<script>
jQuery(function() {
jQuery('#slides').slidesjs({
width: 960,
height: 370,
navigation: {
active: false,
effect: "fade"
},
pagination: {
active: false,
effect: "fade"
},
effect: {
fade: {
speed: 1000
}
},
play: {
auto: true,
interval: 3000,
effect: "fade"
},
callback: {
complete: function(current) {
console.log('current = ' + current);
var total = jQuery("#slides img").length - 2;
if (current >= total) {
clearInterval(jQuery('#slides').data('interval'));
// How do I clear the interval value inside of play:{ interval: 3000 } ?
}
}
},
});
});
</script>
<!-- End SlidesJS Required -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment