[thelist] prev and next

Kevin Raleigh krr at ix.netcom.com
Sun Jul 8 21:09:33 CDT 2001


I need a script that I can use in a framed environment.

The nav frame will control the main frame.

What I have so far is an array of web pages and two functions that 
either add or subtract from that array.

However the script has one minor defect!
It exceeds the max number of items in the array.

I have playing around with it, But I am just taking shots in the dark!

What I had is:

var ind=0
 function next(){
 if(ind<thepages.length){
 top.main.location=thepages[ind+1]
 ind++
  }
}


What I tried to do is:
var thepages=new Array()
thepages[0]="page1.html"
thepages[1]="page2.html"
thepages[2]="page3.html"
thepages[3]="page4.html"
thepages[4]="page5.html"
//etc
var maxPages = 5
var ind=0
 function next(){
 for(i=0; i<thepages.length; i++){
 for(j=0; i<thepages[j]; j++){
 if(thepages[j]<maxPages){
 top.main.location=thepages[ind+1]
 ind++
  }
}
}
}

If you could add some insight here I would really appreciated it.
I can add and work with scripts in a basic way but ...

Thank You
Kevin



















More information about the thelist mailing list