The first time that the pause button is clicked, the rotation stops and all is well. Click again and the rotation continues. But then i can't seem to pause thereafter. Where am i going wrong?
Expand|Select|Wrap|Line Numbers
- function pause() {
- switch (p) {
- case 0:
- document.pausebutton.src="images/pause_on.gif";
- window.clearInterval(timer);
- window.clearInterval(timer2);
- p=1;
- break;
- case 1:
- document.pausebutton.src="images/news.gif";
- var timer2=window.setInterval("section()", 7000);
- p=0;
- break;
- }
- }
- var timer=window.setInterval("section()", 7000);