www.webdeveloper.com
Results 1 to 5 of 5

Thread: variable persistence

  1. #1
    Join Date
    Mar 2003
    Location
    Yardley, PA
    Posts
    60

    Post 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

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    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

  3. #3
    Join Date
    Mar 2003
    Location
    Yardley, PA
    Posts
    60
    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

    ?

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    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

  5. #5
    Join Date
    Mar 2003
    Location
    Yardley, PA
    Posts
    60
    Thank you

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles