/    Sign up×
Community /Pin to ProfileBookmark

variable persistence

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

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Mar 05.2003 — 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
Copy linkTweet thisAlerts:
@russ801authorMar 05.2003 — 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

?
Copy linkTweet thisAlerts:
@khalidali63Mar 05.2003 — 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
Copy linkTweet thisAlerts:
@russ801authorMar 05.2003 — Thank you

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

Success!

Help @russ801 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...