Results 1 to 4 of 4

Thread: PHP Photo Album Script Image Display

  1. #1
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album Script Image Display

    1) Script Title: PHP Photo Album Script

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

    3) Describe problem:

    I have followed the instructions on the script and i was able to install it to my host sever without any problems. My question is how can i display the chosen image (when clicked or when hover) to not pop up to a new window, but rather to display the image on the same page, directly above the 3 column table where the script resides? In other words, how can i call the script to display the selected image in the same table? I have searched the forum for any similar query but to no avail. Any help would be greatly appreciated. Thanks.

    Here is my URL for my test layout: http://www.pastimeragz.com/gallery/

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    First, add a DIV above the table to contain the expanded image, something like:

    Code:
    <div id="imagearea"></div>
    Then, change the function popuplinkfunc() within the script:

    Code:
    function popuplinkfunc(imgsrc){
    if (popupsetting[0]==1){
    var popwin=open(imgsrc.href, "popwin", popupsetting[1])
    popwin.focus()
    return false
    }
    else
    return true
    }
    to:

    Code:
    function popuplinkfunc(imgsrc){
    document.getElementById("imagearea").innerHTML='<img src="'+imgsrc+'"/>'
    return false
    }
    This should cause the image to be loaded inline on the page, inside that DIV.

  3. #3
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply! The modified code works great I have one last question, How do i define a default 1st image to load automatically within the <div id="imagearea"></div> when the page is called? BTW,the modified script is PERFECT, i basically don't want a "blank" space when visitors see my index. By showing an image, visitors will more than likely to browse around instead of seeing a blank display area. Again, thanks for all your help!

    Here is my URL for my test layout: http://www.pastimeragz.com/gallery/

    Randy-

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Well, to define a default image, you could just add an img tag inside the DIV:

    Code:
    <div id="imagearea"><img src="cat.gif" /></div>

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
  •