So I need some help.. I have a page which has this play button, which should start playing its page siblings. And a pause button which should stop the playing. But that's not the problem, I have it figured out.
The problem is that How could I set the pause button to actually pause this :
setTimeout(function() {
window.location.href = "<?php echo get_permalink($nextID);?>";
}, 2000);
I was thinking of making this with cookies, the idea is this : when you enter the page, the cookie's value is set to 1 as a default. And when the default number is true, that above code will start playing the pages after x amount of seconds. And IF the pause button is pressed, the cookie's value is set to 0, and the pages will not play.
And yeah, again if play is pressed it sets the cookie's value to 1.
But that's just my idea, please help!
Thanks for advance!
-Kev