Results 1 to 6 of 6

Thread: Loading a first image in album

  1. #1
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Loading a first image in album

    Script: DD PHP Photo Album script

    Script URL: http://www.dynamicdrive.com/dynamici...photoalbum.htm

    I am using this script in a site and it's working fine with the image displaying on the same page in a div.

    at the moment the Image area is empty when the page loads, is it possible to show the first item in the album by default when the page loads?

    Thanks
    Last edited by SteveC; 10-08-2007 at 10:28 PM. Reason: Incorrect link

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

    Default

    the link doesn't work

  3. #3
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boogyman View Post
    the link doesn't work
    Sorry about that I've replaced the link.

  4. #4
    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

    If you have an image display area, something like so:

    Code:
    <div id="loadarea"></div>
    You can just place the code for your initial image in it:

    Code:
    <div id="loadarea"><img src="first_big.jpg"></div>
    You can put any HTML in there that you like. It will be replaced once the user loads something else in there.
    - John
    ________________________

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

  5. #5
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks so much for the prompt reply.

    Your solution is what I'm using at the moment

    What I would really like to do is load the first image in the gallery array into the display area. so that if I change the contents of the array the first image of the new array will load dynamically.

  6. #6
    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

    I thought you said it was empty. Anyways, you could put a document.write() statement in there, something like:


    Code:
    <div id="loadarea"><script type="text/javascript">
    document.write('<img src="'+imagepath+galleryarray[0]+'">');
    </script></div>
    - John
    ________________________

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

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
  •