[thelist] prev and next
Kevin Raleigh
krr at ix.netcom.com
Sun Jul 8 00:21:58 CDT 2001
I have a partial completed script for the prev and next buttons using a
framed web page
The nav contains the controls and directs them into the body of the web
page.
Problem is, that I haven't been able to figure out how to place the upper
and lower limits
in the script.
Can you take a look and tell me how to place the upper and lower limits so
that when the user reaches
the last page the button is hidden instead of the user loading a page giving
a 404.
Thank You
Kevin
The Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var thepages=new Array()
thepages[0]="ImageMapFolders/1-24/imagemap1.html"
thepages[1]="ImageMapFolders/25_48/imagemap2.html"
thepages[2]="ImageMapFolders/49_72/imagemap3.html"
thepages[3]="ImageMapFolders/73_96/imagemap4.html"
thepages[4]="ImageMapFolders/97_/imagemap5.html"
//etc
var ind=1
function next(){
if(ind<thepages.length){
top.main.location=thepages[ind+1]
ind++
}
}
function prev(){
if(ind>0){
top.main.location=thepages[ind-1]
ind--
}
}
//-->
</SCRIPT>
<a href="javascript:void(0);" onClick="prev();">prev</a>
<a href="javascript:void(0);" onClick="next();">next</a>
More information about the thelist
mailing list