SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Pop-up window problem...

    Hi
    I have some thumbnails that when clicked open up the full images in pop-up windows. The problem is my images appear to be aligned to the bottom right of the pop-up window leaving a white strip along the top and left hand side. I have set the pop-up window size settings (in the behaviours panel) to match the exact size of the image but i still get the white space as mentioned above.
    Surely i must be doing something simple wrong here...

    Sorry i'm unable to offer an online example at the moment.

    Thanks.

  2. #2
    SitePoint Guru r2d2's Avatar
    Join Date
    Dec 2003
    Location
    In my van, fool!
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe need to set the margin and padding to 0 for the body tag? I.e.
    Code:
    <body style="margin:0; padding:0;">

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im sorry im not quite with you...where would i place this code.

    In the 'Open Browser Window' dialogue box under 'url to display' i am linking directly to the full size image not a page as such...

    Where an i find the code for the pop-up at?

    Thanks

  4. #4
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're just referencing an image directly, you can't control the amount of white space around it in the browser window - that's controlled by the user's IE settings.

    The only way AFAIK to do this would be to create a page to hold the image (you could do this quite simply using server-side scripting). Or why not make your window bigger so that the white space is the same all the way round?

  5. #5
    SitePoint Guru r2d2's Avatar
    Join Date
    Dec 2003
    Location
    In my van, fool!
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah sorry, I thought you were showing the img in a html page.

    I think Buddy is right, when just displaying an img, IE and Mozilla both add different padding to the img on the top and left. (Try making the window of your pop ups bigger and you will see its applying padding, not aligned to bottom right.)

    Buddy's suggestion of creating a page to hold the image is the only way you can control the padding I think. The best way to do this would be with a server side scripting language like PHP, so you only need to create 1 page. You could create a page for each image but this would take a long time, depending on how many images you have I guess and how many you plan on adding in the future.

  6. #6
    SitePoint Member [m]'s Avatar
    Join Date
    Jan 2004
    Location
    Spijkenisse, the Netherlands.
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why the need for so many pages? The popup is already javascript, so just one will suffice:

    (assuming the pic's dimensions 500 * 400)

    link:
    Code:
    <a href="img.jpg" onClick="window.open('popup.html?' + this.href, '' , 'width=500,height=400'); return false;">view img.jpg</a>
    popup.html:
    Code:
    <html>
    <head>
    <title>popup - close to return to the page</title>
    </head>
     
    <body style="margin:0;padding:0;">
    <script type="text/javascript">
    document.write('<img src="' + new String(self.location).split("?")[1] + '"></img>');
    </script>
    </body>
    </html>

  7. #7
    SitePoint Guru r2d2's Avatar
    Join Date
    Dec 2003
    Location
    In my van, fool!
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah yes, good plan - If you're ok using JavaScript that is, I think only 75-80% have it enabled...

  8. #8
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you may be interested in this old thread http://www.sitepoint.com/forums/show...le+image+popup
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  9. #9
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah i figured on making the window slightly larger thus giving me white space on all four sides but i hope to eventually have quite a few images up so perhaps for the long term the php route would be the way to go. Strangely enough i just picked up 'Php and MySQL for dynamic websites' at the local bookshop last week with the intention of learning a new skill over the winter months. I'm sure the php forum guys are gonna be sick of me come the summer lol.

    Thanks for the fast and helpfull advice


    Cheers Dedux

  10. #10
    SitePoint Member [m]'s Avatar
    Join Date
    Jan 2004
    Location
    Spijkenisse, the Netherlands.
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r2d2
    Ah yes, good plan - If you're ok using JavaScript that is, I think only 75-80% have it enabled...
    Well, popups are usually javascript, aren't they. So adding a bit more is not a problem.

    And it will show the picture even without javascript enabled. That's better than the standard popup behaviours in DW.

    Quote Originally Posted by whiteline
    Yeah i figured on making the window slightly larger thus giving me white space on all four sides but i hope to eventually have quite a few images up so perhaps for the long term the php route would be the way to go.
    Going the php route? That's only going to make the problem worse. If you want to have popups (and adjustable bars, size, etc), you are already using javascript. Better go all the way then.

    Btw. r2d2, I have never met or read about a person who had javascript disabled. Some have popup blockers, but that's about it. I would definately like to know where those nubers come from. Besides, it all depends on your target audience anyway. Grannies don't know what javascript is, so they'll all have it enabled. But if you are designing for internetting purists/fetisjists, you can count on them heving it disabled. Thank god there are very few of those around.

  11. #11
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by [m]
    Going the php route? That's only going to make the problem worse.
    aeh...how ?

    Btw. r2d2, I have never met or read about a person who had javascript disabled. Some have popup blockers, but that's about it. I would definately like to know where those nubers come from. Besides, it all depends on your target audience anyway. Grannies don't know what javascript is, so they'll all have it enabled. But if you are designing for internetting purists/fetisjists, you can count on them heving it disabled. Thank god there are very few of those around.
    don't forget large corporations which have (and mandate) javascript turned off for "security reasons"...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  12. #12
    SitePoint Member [m]'s Avatar
    Join Date
    Jan 2004
    Location
    Spijkenisse, the Netherlands.
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by redux
    aeh...how ?



    don't forget large corporations which have (and mandate) javascript turned off for "security reasons"...
    Well, to add php to the whole business add anoth layer of code. That means if something goes wrong, it'll be alot more difficult to find the problem. Why make it difficult if it can be done the easy way?

    Ah yes, that is true. But surfing for personal pleasure under the boss' time isn't corporate policy, either.

  13. #13
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by [m]
    Ah yes, that is true. But surfing for personal pleasure under the boss' time isn't corporate policy, either.
    but what if it's not for pleasure ? what if the site that needs to have this image popup is a corporate/business site ?
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  14. #14
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What have i started...
    The site is/will be just a personal one, more an experiemental type thing where i can try out new skills/techniques etc and hopefully help develop my web design skills further.
    The reason the php appealed to me was like i say, i'd just purchased a book on the subject with the intention of maybe creating an online database for my vast collection of music. Again this wouldn't be for any commercial use/gain but for my own learning purposes...

  15. #15
    SitePoint Guru r2d2's Avatar
    Join Date
    Dec 2003
    Location
    In my van, fool!
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by [m]
    Btw. r2d2, I have never met or read about a person who had javascript disabled... ....Grannies don't know what javascript is, so they'll all have it enabled. But if you are designing for internetting purists/fetisjists, you can count on them having it disabled. Thank god there are very few of those around.
    Guess you hadnt read the end of your own paragraph then?

    Hehe, This site has stats of user details, including Javascript. Check Javascript for May 2003.

    Ok maybe only 80% was a bit low, but its not even 90%.


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
  •