View Full Version : Pop up window size and border

Jan 19th, 2006, 04:27 AM

I am using Dreamweaver to open a pop up window when you click in a thundnail to make the picture bigger. In Dreamweaver you have the option to specify the dimensions of the pop up window(in my case the same as the photograph). It seems to work fine in Explorer, but Safari leaves a white border along the right and bottom edges(aprox 14 pix). I have tried to do the window smaller but then in other browsers you need scroll bars. I would like the new window be exactly the same size of the photograph. Is there any easy way to control this? I have experience designing with css, but never worked with javascript. :)

Thank you very much for any advice about this,


Jan 19th, 2006, 06:23 PM
on the popup page



havn't tested it. look into that tho.

Jan 19th, 2006, 09:07 PM
Hi rlemon!

Thanks for your answer. Since i am using Dreamweaver I do not have access to the pop up window. All javascript is in the thundnail page as follow. I have tried to paste your code inside the javascript below, but it seems not to affect the final image.
Let me know if you have any ideas, and thanks again


function MM_openBrWindow(theURL,winName,features) { //v2.0

<div id="wrapper">
<div id="main"><a href="javascript:;" onclick="MM_openBrWindow('images/atglitters02g.jpg','','width=361,height=361')"><img src="images/over-allp.jpg" name="image1" border="0" id="image1" /></a> <a href="javascript:;" onclick="MM_openBrWindow('images/legsg.jpg','','width=361,height=361')"><img src="images/atglitters01p.jpg" width="90" height="90" border="0" /></a> <a href="javascript:;" onclick="MM_openBrWindow('images/all02g.jpg','','width=478,height=360')"><img src="images/atglitters06p.jpg" width="120" height="90" border="0" /></a> <a href="javascript:;" onclick="MM_openBrWindow('images/atglitters03g.jpg','','width=360,height=360')"><img src="images/videop.jpg" width="90" height="90" border="0" /></a> <a href="javascript:;" onclick="MM_openBrWindow('images/atglitters05g.jpg','','width=434,height=360')"><img src="images/atglitters05p.jpg" width="108" height="90" border="0" /></a> <a href="javascript:;" onclick="MM_openBrWindow('images/atglitters04g.jpg','','width=360,height=360')"><img src="images/gold-shoesp.jpg" width="90" height="90" border="0" /></a> </div>

Jan 19th, 2006, 09:29 PM
When you just load an image into a popup window you get the default margins around it which are different from one browser to another. Either make the window big enough so that the image can display with a white border (not necessarily evenly on all sides) or put the image into a web page and load that into the popup window instead. With a web page you can put body {margin:0} into the stylesheet to get the image right into the top left corner.

See http://javascript.about.com/library/blpop.htm and http://javascript.about.com/library/blpopup9.htm for more about how to do this.