C
Charles Packer
From one of the online Javascript tutorials, I learned how to
open a new window and set its size. I'm building a page that has
several small photographs, and I want to let the viewer examine
either a full size image or an image with supporting detail.
It's the same idea used on lots of Web sites that show thumbnails
where you click on one and the full-size image is displayed in a
new window. However, I have different-sized images that will appear
in the new window, and I want it to resize automatically to
accommodate each new image. I don't know how to do that. The page
in question is at
http://cpacker.org/misc/petersquare
What happens with this page is that the new window has the
dimensions of the first image first clicked on. Click on another and
the new image appears in the window, but the window retains the dimensions
of the first image.
Also, "resizable=no" didn't work for me -- I could still drag on
the lower right corner of the new window and resize it manually.
I assume that's what the option is supposed to control.
Oddly enough, when I bundled the Javascript statements in a <SCRIPT...</SCRIPT>
bracket above the </HEAD> in the manner of some Web sites, the new window
retained the height of the first image, but was always about 100 pixels wide.
I browsed this newsgroup and there are a lot of threads about this issue.
learned about window.resizeTo, but that didn't work. For example,
I tried
function A1() { window.resizeTo(865,795); window.open('stpeters.jpg'...
but still got the tall skinny window I mentioned above.
Any help would be appreciated.
open a new window and set its size. I'm building a page that has
several small photographs, and I want to let the viewer examine
either a full size image or an image with supporting detail.
It's the same idea used on lots of Web sites that show thumbnails
where you click on one and the full-size image is displayed in a
new window. However, I have different-sized images that will appear
in the new window, and I want it to resize automatically to
accommodate each new image. I don't know how to do that. The page
in question is at
http://cpacker.org/misc/petersquare
What happens with this page is that the new window has the
dimensions of the first image first clicked on. Click on another and
the new image appears in the window, but the window retains the dimensions
of the first image.
Also, "resizable=no" didn't work for me -- I could still drag on
the lower right corner of the new window and resize it manually.
I assume that's what the option is supposed to control.
Oddly enough, when I bundled the Javascript statements in a <SCRIPT...</SCRIPT>
bracket above the </HEAD> in the manner of some Web sites, the new window
retained the height of the first image, but was always about 100 pixels wide.
I browsed this newsgroup and there are a lot of threads about this issue.
learned about window.resizeTo, but that didn't work. For example,
I tried
function A1() { window.resizeTo(865,795); window.open('stpeters.jpg'...
but still got the tall skinny window I mentioned above.
Any help would be appreciated.