Click to See Complete Forum and Search --> : popup window alignment


SamGib
05-12-2003, 08:29 AM
Hi there,

I want to pop up a new window containing a single image and have the window fit around the image exactly. I'm using the following code and a new window is created which contains the image, but even though I've passed the popup window width and height parameters to exactly match the width and height of the .jpg image, the image doesn't exactly fit the window - there is white space (about 20 pixels or so) on the top and left border of the image, and the bottom and right sides of the image are cropped.

Here's the code in the head section of the page:

// open window - popup

function openwin(URL,name,features) {
pop=window.open(URL,name,features);
}

And here's the code from an href link further on down the page:

<a href="javascript: popup=openwin('images/Corlandojumpinglarge.jpg','popup','width=400,height=287')">


Any ideas on how to eliminate the white space in the new window so the image fits perfectly?

Thx very much!

Sam

pyro
05-12-2003, 08:31 AM
Try looking at this code: http://www.infinitypages.com/research/imagepopup.htm

SamGib
05-13-2003, 05:44 AM
Thanks Pyro - your code works great - much appreciated!

Sam

pyro
05-13-2003, 07:09 AM
You're welcome!