Log in

View Full Version : PHP Photo Album script



jjstccean
12-31-2008, 06:59 AM
How can I get the pop up form to appear in the middle of the screen? This web address refers. http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm

Thank you.
jjstccean:)

ddadmin
12-31-2008, 08:55 AM
Assuming you're using the default code that came with the script to pop up a window:


var popwin=open(imgsrc.href, "popwin", popupsetting[1])

Centering it would be a matter of calling popwin.moveTo() (http://www.javascriptkit.com/jsref/window.shtml) and moving it to the appropriate coordinates on the screen. Something like:


var winx=screen.availWidth/2-500/2
var winy=screen.availHeight/2-600/2
popwin.moveTo(winx, winy)

Where 500 and 600 are assumed to be the dimensions of your pop up window (width and height).

jjstccean
12-31-2008, 03:39 PM
Thank you kindly DD. If I may, these numbers, what do they represent?
var winx=screen.availWidth/2-500/2
var winy=screen.availHeight/2-600/2

I've pasted this code as you've suggested - the pop up window does pop up in the center of the screen - though it is very small: +- 120px x 120px. Any suggestions please?

Am I doing anything wrong? Please excuse my ignorance as my knowledge of PHP is very limited. :confused:

Thank you.

Regards,

jjstccean.

ddadmin
01-01-2009, 09:25 AM
Are you saying the pop up window is very small (120x120)? Its size is based on the settings you've defined inside the original code, specifically, this line:


//Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
var popupsetting=[1, "width=500px, height=400px, scrollbars, resizable"]

jjstccean
01-02-2009, 07:41 AM
thank you DD. :) I played with the settings - still no luck, the popup window remain small - i played with popupsettings from 1 to 0 which maximize the window -
this line: var popupsetting=[1, "width=500px, height=400px, scrollbars, resizable"] has no effect after adding this:

var winx=screen.availWidth/2-500/2
var winy=screen.availHeight/2-600/2
popwin.moveTo(winx, winy)

please know that I'm referring to the this section:

//By default, each image hyperlinks to itself.
//However, if you wish them to link to larger versions of themselves
//Specify the directory in which the larger images are located
//The file names of these large images should mirror those of the original
//Enter a blank string ("") to disable this option
var targetlinkdir="http://www.microtiger-za.co.za/largefoto/"

Thank you very much for your trouble.

jjstccean

ddadmin
01-02-2009, 08:55 AM
Did you try changing the values I highlighted in red above? If so and it still doesn't work, please post a link to the page on your site that contains the problematic script so we can check it out.

jjstccean
01-02-2009, 10:30 AM
http://www.microtiger-za.co.za/fotoAlbum.html thank you DD. though, in the interim I've discovered where I'm going wrong. I've been checking my web site results using "chrome" - then a birdie tells me, check it out also with IE and Firefox! and lo and behold it's working! so sorry about all my terrible mix-up. And thank you again for your kind assistance. For the record, I'm I the only one having this problem in "Google Chrome"? Do you guys use/test chrome?

Regards,

jjstccean.