Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-19-2006, 04:27 AM   PM User | #1
Tucho
New to the CF scene

 
Join Date: Jan 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Tucho is an unknown quantity at this point
Pop up window size and border

Hi,

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,

Tucho
Tucho is offline   Reply With Quote
Old 01-19-2006, 06:23 PM   PM User | #2
rlemon
Senior Coder

 
Join Date: Apr 2005
Posts: 1,051
Thanks: 0
Thanked 0 Times in 0 Posts
rlemon is on a distinguished road
on the popup page

document.body.resize(h,w);

document.body.resize(imgObj.innerHeight,imgObj.innerWidth);

havn't tested it. look into that tho.
__________________
public string ConjunctionJunction(string words, string phrases, string clauses)
{
return (String)(words + phrases + clauses);
}
<--- Was I Helpfull? Let me know ---<
rlemon is offline   Reply With Quote
Old 01-19-2006, 09:07 PM   PM User | #3
Tucho
New to the CF scene

 
Join Date: Jan 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Tucho is an unknown quantity at this point
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

Tucho

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<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>
Tucho is offline   Reply With Quote
Old 01-19-2006, 09:29 PM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,454
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:34 AM.


Advertisement
Log in to turn off these ads.