Autoresizable image popup

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Autoresizable image popup

Post by Ree »

I have quicly wrote this:

Code: Select all

function showImage(image_url)
{
  var picture = new Image();
  picture.src = image_url;
  window.open(image_url, '', 'width='+picture.width+', height='+picture.height+', scrollbars=0');
}
It works ok with IE, but Firefox displays some margin around the image. How do I get rid of it?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Firefox resizes images to fit inside their window. That might be what's doing it.

It also looks like you haven't turned off toolbars and the status bar. Both of those will eat into your dimensions.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Post by Ree »

Firefox does not resize images. Also the toolbar isn't displayed. Status bar shouldn't be a problem either.
Post Reply