A slide show with JavaScript using Frames - Page 3

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

The function that moves the pages back in sequence is called retrace. Here is the code:

/* ####################### retrace() shows the previous page

####################### */

function retrace()

{

if (thisPage==0){

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

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

alert('Start of series - no previous pages')

thisPage=0

}

else

if(thisPage==1){

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

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

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

thisPage=0

}

else {

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

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

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

thisPage=thisPage-1;

}

}

 


Ken Ward's HTML Guide...

 


[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