Inner Resize Browser Window
This JavaScript function will resize the inside of a browser window to the dimensions provided.
function innerResizeWindow(innerWidth, innerHeight) {
if (self.innerWidth) {
myInnerWidth = self.innerWidth;
myInnerHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth) {
myInnerWidth = document.documentElement.clientWidth;
myInnerHeight = document.documentElement.clientHeight;
}
else if (document.body) {
myInnerWidth = document.body.clientWidth;
myInnerHeight = document.body.clientHeight;
}
else {
return;
}
adjustWidth = innerWidth - myInnerWidth;
adjustHeight = innerHeight - myInnerHeight;
window.resizeBy(adjustWidth, adjustHeight);
}
window.onload = innerResizeWindow(800,600);

Comments
Thanks - Great Job!
ResizeBy does not work for Chrome. Are you aware of any solutions?
I have only used Chrome a little bit and so far have not needed this script to work in it.
What version are you using?
The latest version
this is great! thanks for your help
Thanks for this! Works great.
Post new comment