The file which does all the work in this slide show is slide-showNavigator.htm. To move pages around, we must first catch our pages ... and in this case we catch them in an array. We use two arrays: One to hold the URLs and another to hold the descriptions of the pages (which show in the boxes below).
The code holding the filenames is:
varURLList = new Array()
And the list containing the text descriptions is as follows.
URLText='The data in Arrays'
So we have caught our data in ARRAYs and now we can work on it with the script. But first let us look at the HTML code for the navigator file. The important thing here is the names of the text boxes and the checkbox, which we will use in the code.
<form name="form1" id="form1" action="">
<table border="0" width="95%">
<input type="button" value="Back to >>" onclick="retrace()" />
<!-- The above button calls the function retrace() which we will use to move backwards in the sequence. The next button calls the function showPage() which we use to move forwards in the sequence-->
<input type="button" value="Forward to >>" onclick="showPage()" />
Check the box for automatic mode
<td valign="top" width="150">
<input type="text" name="textPrevious" id="textPrevious" value="Previous Article" size="29" />
<!-- The text boxes, textPrevious and textNext hold the descriptions of the URLs of the pages before and after in the sequence. They have default values which we change when we start moving the pages. -->
<td valign="top" align="left" width="150">
<input type="text" name="textNext" value="Next Article" size="32" />
<!-- Finally, we have the checkbox below which we use to make the pages move automatically or to stop them moving. Clicking this box calls the function automatically() which moves the pages automatically through the sequence. -->
<input type="checkbox" onclick="automatically()" name="automatic" id="automatic" size="25" maxlength="25" value="ON" />
As we have not put CHECKED in the code for the checkbox, it if off by default. So it starts off unchecked and you have to click on the buttons to move through the slide show.
|[If you need to learn more about HTML visit the HTML Tutorial]
To ask questions, make comments, etc,