Results 1 to 2 of 2

Thread: Loading first image in array into a div on same page

  1. #1
    Join Date
    May 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Loading first image in array into a div on same page

    1) Script Title: DD PHP Photo Album script

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

    3) Describe problem: Excellent script which does everything except one final thing. I have the links load in the same page with the use of a div ID "targetdiv"
    and I would like to load the first image in the array/thumb list when the user lands on the page.

    I found this thread alluding to an answer but when I tried it it doesnt appear to work: http://www.dynamicdrive.com/forums/s...to+album+image

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Oh, it works alright. However, you may need to use a little javascript to pull the first image from the galleryarray array if you don't already know what it will be. This would of course have to be done after the PHP Photo Album script has sorted the galleryarray array, and after the targetdiv division is parsed by the browser. And, depending upon how you are populating the targetdiv division, you should probably just use that same method.

    But if you know what the first image will be, and you are populating the targetdiv by overwriting its innerHTML, you can just hard code the image in there.

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sany (09-30-2008)

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
  •