Forum Moderators: open

Message Too Old, No Replies

can't get window size to fit image

         

Powdork

9:57 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using the following code to try and open a window the exact size of the image the thumbnail links to. But it keeps resizing the image so that it doesn't quite fill the window.

<a href="javascript:;" onClick="MM_openBrWindow('homepagegallery/images/image.jpg','','width=275,height=377')">
<img src="/homepagegallery/thumbnails/image.jpg" alt="Our own image" width="54" height="75" border="1"></a>

Any ideas?

pageoneresults

10:00 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you using IE to view the page? If so, you may have the Automatic Image Resizing feature checked. Go to...

IE > Tools > Internet Options > Advanced > Multimedia > Uncheck Enable Automatic Image Resizing

Could that be it?

DrDoc

10:18 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try and open a window the exact size of the image

The new window by default has padding. You need to either resize the window to leave room for padding (~ 20px extra width and height) or open the image inside a Web page that will clear the padding. A PHP script would work well.

Powdork

11:05 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The new window by default has padding. You need to either resize the window to leave room for padding (~ 20px extra width and height) or open the image inside a Web page that will clear the padding. A PHP script would work well.
I was thinking that was it. I hoped I could remove the margins and such from the parent page and it would hold on to those properties. That didn't work either though. I guess new pages is the way to go.

cpear

12:24 am on Jan 3, 2004 (gmt 0)

10+ Year Member



Have you tried using the these attributes in the body tag of the window you are opening?
<body topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0" >

Powdork

2:04 am on Jan 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's what I'm going to have to do it looks like. Right now it's just opening a jpeg

CloudLong

7:52 am on Jan 3, 2004 (gmt 0)

10+ Year Member



you must not give the direct url to your image file, it will resize.

you must refer to the page that show your image.

So:

<a href="javascript:;" onClick="MM_openBrWindow('tothepagethatshowyourimage.html','','width=275,height=377')">