Results 1 to 3 of 3

Thread: Array Change?

  1. #1
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Array Change?

    1) Script Title: Photo Album 2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem: Is it possible to alter the code the the array is read in reverse?

    My thought is that the photo album array is read with 0 always being at the front of the album. This means that everytime the album is updated the array needs to be changed.
    Code:
    var myvacation=new Array()
    myvacation[0]=["0.jpg", "", "photo.jpg"]
    myvacation[1]=["1.jpg", "", "photo1.jpg"]
    myvacation[2]=["2.jpg", "", "photo2.jpg"]
    myvacation[3]=["3.jpg", "", "photo3.jpg"]
    myvacation[4]=["4.jpg", "", "photo4.jpg"]
    myvacation[5]=["5.jpg", "", "photo5.jpg"]
    It would make updating the album easier if the last number [5] was the first image in the album and 0 was the last item to be displayed. Is this possible?

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    myvacation.reverse()

  3. #3
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    Worked prefectly!

Bookmarks

Posting Permissions

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