PDA

View Full Version : PHP Photo Album Script Image Display



pastimeragz
07-10-2006, 01:51 PM
1) Script Title: PHP Photo Album Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-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/

ddadmin
07-10-2006, 06:51 PM
First, add a DIV above the table to contain the expanded image, something like:


<div id="imagearea"></div>

Then, change the function popuplinkfunc() within the script:


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

to:


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.

pastimeragz
07-10-2006, 08:42 PM
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-

ddadmin
07-10-2006, 09:15 PM
Well, to define a default image, you could just add an img tag inside the DIV:


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