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


tallen240
09-27-2003, 02:35 PM
Anyone know how to set a maximum size limit for the new window with this one:
http://javascript.internet.com/page-details/resizable-viewer.html

I like everything about it except some of my images are quite tall and the autosize feature makes the window run off the screen so there is no way to see the bottom of the image.

The autosize feature is one of my favorite things about it so I don't want to lose that completely, just be able to set a maximum size that it won't exceed for the window.

thanks!
Trevor

pyro
09-27-2003, 02:41 PM
Looks like they are storing the height the window needs to be in the variable myHeight, so just check if that is greater than the max you want to allow, and if so, set it to the max, like this:

if (myHeight > 600) {
myHeight == 600;
}Better yet, since they are detecting the height of the screen, and putting that into the variable height, you could do something like this:

if (myHeight > height) {
myHeight == height;
}and just be sure you put the code before this line:

var toppos = height / 2 - myHeight / 2;