My slideshow is running continuously, without user interaction. Since the show runs fullscreen there are no controls, as meant. However, Occasionnaly the user should be able to freeze the show in case she want to inspect a picture [work of art] more carefully. I wonder if this can be done by adding an eventListener(keydown) enabling the user to toggle, say spacebar (Keycode == 32) to freeze or to continue the show. Relevant piece of code:
<body>
...
(function loop() {
rantime = Math.round(Math.random() * (9000 - 2000)) + 1000;
setTimeout(function() {
rotateImage();
loop();
}, rantime);
})();
So far I didn't found any suggestion to solve this problem. [clearTimeout, if possible, only skips the present image for the next] The point of toggling, of course is that the user can postpone continuation of the show indefinitely, rather than finish the show. Any help would be appreciated. Wimsch
clearTimeout(which is the correct solution) already? Can you show us that code?