Results 1 to 7 of 7

Thread: PHP Photo Album script

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

    Question PHP Photo Album script

    How can I get the pop up form to appear in the middle of the screen? This web address refers. http://www.dynamicdrive.com/dynamici...photoalbum.htm

    Thank you.
    jjstccean

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

    Default

    Assuming you're using the default code that came with the script to pop up a window:

    Code:
    var popwin=open(imgsrc.href, "popwin", popupsetting[1])
    Centering it would be a matter of calling popwin.moveTo() and moving it to the appropriate coordinates on the screen. Something like:

    Code:
    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).
    DD Admin

  3. #3
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question PHP Photo Album script

    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.

    Thank you.

    Regards,

    jjstccean.

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

    Default

    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:

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

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    jjstccean (01-02-2009)

  6. #5
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default PHP Photo Ulbum script

    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

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

    Default

    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.
    DD Admin

  8. The Following User Says Thank You to ddadmin For This Useful Post:

    jjstccean (01-02-2009)

  9. #7
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    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.
    Last edited by jjstccean; 01-05-2009 at 06:45 AM. Reason: not finalised.

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
  •