Let me say in advance that this is all new to me, and I am sure that I am missing something obvious, but I'm stumped.
I am working on adding start and stop functionality to the very excellent mooShow slideshow script. The 'autoPlay' function works fine, and 'startautoPlay' works by itself as well, but I cannot seem to make it stop once it has started. I've been fumbling around with this for all week, to no avail. I thought that using a variable and a while statement would do the trick, but adding the 'while' just crashes the browser (if the while is removed, and the 'startautoplay' is allowed to call 'autoplay' after the 'if...else' statement dealing with the timing of the slideshow, it works exactly as I expect it to).
Any help or insight would be greatly appreciated.
I am working on adding start and stop functionality to the very excellent mooShow slideshow script. The 'autoPlay' function works fine, and 'startautoPlay' works by itself as well, but I cannot seem to make it stop once it has started. I've been fumbling around with this for all week, to no avail. I thought that using a variable and a while statement would do the trick, but adding the 'while' just crashes the browser (if the while is removed, and the 'startautoplay' is allowed to call 'autoplay' after the 'if...else' statement dealing with the timing of the slideshow, it works exactly as I expect it to).
Code:
function autoPlay (delayTime,showName) { window.setInterval("mooShows[showName].nextImage()", delayTime); } function startautoPlay (newdelayTime) { // Starts automatic slideshow via web link // Defaults to 5 second delay if no delay time is set var canPlay = 1; if (newdelayTime > 0) { this.delayTime = newdelayTime; } else { this.delayTime = 5000; } while(canPlay = 1){ autoPlay(this.delayTime, showName); } } function stopautoPlay () { // Turns slide mode off setcanPlay = 0; }
Comment