Pause or Continue the autoplay

⚠️ This article was created for developers!

To be able to follow the steps, you're required to have coding knowledge. If you're not a developer and can't achieve what you're looking for, consider hiring a developer.

Make sure to carefully follow the tutorial and write correct code. We're unable to provide help with custom coding, or the possible issues that are happening because of them.

The first thing you need to make the autoplay stop or continue is the ID of your slider. In this example I'll use 10 as the slider ID.

Stop the autoplay
window['n2-ss-10'].pauseAutoplay();
Resume the autoplay
window['n2-ss-10'].startAutoplay();
Example

This code assumes you have the Autostart enabled.

<div onclick="customAutoplay();">Click to stop or continue the autoplay</div>
<script>
var autoplayCounter = 0;
function customAutoplay(){
   if(autoplayCounter%2==0){
        window['n2-ss-10'].pauseAutoplay();
   } else {
       window['n2-ss-10'].startAutoplay();
   }
   autoplayCounter++;
}
</script>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.