A slide show with JavaScript using Frames - Page 4

Previous Tutorial:Image Slide Show
Next Tutorial: New Image Everytime You Visit the Page

Finally, there is a function which moves through the pages automatically when the checkbox is checked. This is called automatically. Here is its code:

function automatically() {

if (document.form1.automatic.checked) {

if (thisPage==0){

document.form1.textPrevious.value='Start of series'

document.form1.textNext.value=URLText[1]

parent.frames[0].location.href = URLList[0];

thisPage=thisPage+1;

}

else

if(thisPage==numurls-1){

document.form1.textPrevious.value= URLText[thisPage-1]

document.form1.textNext.value='End of series'

parent.frames[0].location.href = URLList[thisPage];

thisPage=0}

 

else {

document.form1.textPrevious.value= URLText[thisPage-1]

document.form1.textNext.value=URLText[thisPage+1]

parent.frames[0].location.href = URLList[thisPage];

thisPage=thisPage+1;

}

 

var delay = setTimeout("automatically()",3500)

}

}

 


Ken Ward's HTML Guide...

Next Page: A new image everytime you visit the page


[If you need to learn more about HTML visit the HTML Tutorial]

To ask questions, make comments, etc,
use the mailing list

I am always pleased to hear from you.
To ask questions, make comments, etc,
use the mailing list : Click here to join 1stJavaScript