Hello,
I am trying to resize a popup to fit an image for IE, but when the image is bigger that the available screen size IE still goes to the image size. Below is the code I am trying to use.
The idea is to open a popup, load an image, resize the popup to the image. If the image is bigger than the screen, then resize the popup to the screen size.
I have it working in NS, all versions, but I cannot get it to work in any version of IE.
I would like it to work in IE for versions 4 and above
Your assistance is greatly appreciated.
if (isIE4) {
window.moveTo(0,0);
//window.resizeTo(500, 500);
width = 500 - (document.body.clientWidth - document.images[0].width);
height = 500 - (document.body.clientHeight - document.images[0].height);
if ( height > window.availHeight ) {
height == window.availHeight;
}
if ( width > window.availWidth ) {
width == window.availWidth;
}
window.resizeTo(width, height);
}
}
I am trying to resize a popup to fit an image for IE, but when the image is bigger that the available screen size IE still goes to the image size. Below is the code I am trying to use.
The idea is to open a popup, load an image, resize the popup to the image. If the image is bigger than the screen, then resize the popup to the screen size.
I have it working in NS, all versions, but I cannot get it to work in any version of IE.
I would like it to work in IE for versions 4 and above
Your assistance is greatly appreciated.
if (isIE4) {
window.moveTo(0,0);
//window.resizeTo(500, 500);
width = 500 - (document.body.clientWidth - document.images[0].width);
height = 500 - (document.body.clientHeight - document.images[0].height);
if ( height > window.availHeight ) {
height == window.availHeight;
}
if ( width > window.availWidth ) {
width == window.availWidth;
}
window.resizeTo(width, height);
}
}