Click to See Complete Forum and Search --> : variable persistence


russ801
03-05-2003, 08:28 AM
Actually two issues. multivariate array and variable persistence.

I am creating a site using frames. One of my pages will be a photo slide show. I prefer to use an array to provide navigation in the slide show rather than using seperate pages and hard coding the navigation. I think I have that down.

But some of these images have associated pages with additional images. I would like to use the array to track those pages as well.

Here is what I would like the array to look result.

slide[1]=(img1.jpg, null)
slide[2]=(img2.jpg,img2c.htm)
slide[3]=(img3.jpg, null)
etc.

how do I create the array?

For those images that have associated pages, I would like to provide a link to the second value. If I can get it into the array , I can get it out (I think). This will load the associated page in the frame. the user then should be able to go back to the page he/she just left. no problem.

But how do I ensure that the user will return to that slide show with the last image viewed?

I am considering a global variable initialized on the navigation page(frame) and updated on the slide show page; then using that to select the correct array element.

First time I have started to do more than cut and paste js. please help me learn to fish

Russ

khalidali63
03-05-2003, 08:35 AM
The correct syntax should be

var slide = new Array(
new Array(img1.jpg, null),
new Array(img2.jpg,img2c.htm),
new Array(img3.jpg, null)
);

I hope this helps

Cheers

Khalid

russ801
03-05-2003, 08:46 AM
It does. Basically to create a multivariate array; you nest an array within an array.

What is the syntax for the elements

slide[2]=(img2.jpg, img2c.htm)

or

slide[2,]=(img2.jpg)
slide[,2]=(img2c.htm)

or

?

khalidali63
03-05-2003, 08:51 AM
What do you mean,?

How to access a prticular element?

in the above example
slide[1][0]
will give you = img2.jpg
and
slide[1][1]
will give you = "img2c.html"


Cheers

Khalid

russ801
03-05-2003, 11:55 AM
Thank you

I wasn't sure if the second value was independent of the first.