|
|
Q475 Is it possible to pop-up a window the same size as the image it contains?
irt.org | Knowledge Base | JavaScript | Window | Q475 [ previous next ] Q475 Is it possible to pop-up a window the same size as the image it contains?Not easily. First you have to know the size of the image. Then you have to be able to pass the name of the image to the popup window. With Netscape Navigator you can pass a search string, with Internet Explorer this works online but not offline. Then you have to attempt to reduce the margins to zero. Not easily done in Netscape, except Netscape Navigator 4 which allows you to set the margins in the BODY tag, although you could get around this by loading a frameset in the new window with a hidden frame - this makes it easier to control the margins. Also the more up-to-date browsers will not allow you to open very small windows, e.g. sub 100x100 (its a potential security hole if they do). If that hasn't put you off... First lets open a window:
Then in aframe.htm:
And in blank:
And in apage.html:
Selva Kumar writes: Here is a better solution:
The following was submitted by Dan Souza Here is an easy way to do it. It's a shortcut. Make an HTML page out of your image. The page should contain nothing but the image. Then use CSS to put your image flush left and flush top. Then open your pop up window to contain the HTML page the size of the image. For example, you have image.jpg which is 100 x 200. Use the following
Now in the page that you want to put the popup into insert the following:
Substitute XXX in left, top, screenx, and screeny for the screen position where you'd like the popup to appear. (Netscape doesn't recognize left and top, you have to use screenx for left, and screeny for top) The popup will now contain the image exactly with no space and no border Feedback on 'Q475 Is it possible to pop-up a window the same size as the image it contains?' |
-- div -->
|