By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,775 Members | 1,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,775 IT Pros & Developers. It's quick & easy.

Resize browser window... why such a pain?

P: n/a
jef
I have an Intranet application that is targeted to IE browsers only.
It is also designed explicitly to fit an 800x600 window. That said, I
wish to ensure that the browser window sizes appropriately when they
log in. I'm using this right now:

<HEAD>
<title>My Login Page</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<script type="text/javascript">
{
window.resizeTo(828,732)
}
</script>
</HEAD>

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
jef
Oops... the rest of the post got chopped off.

My existing solution is funky because it only works if the user has the
default toolbar/menubar configuration of IE. I need a way to force the
window to resize based on the content being 800x600 regardless of the
menubar/toolbar height.

Jul 23 '05 #2

P: n/a
jef wrote:
I have an Intranet application that is targeted to IE browsers only.
It is also designed explicitly to fit an 800x600 window. That said, I
wish to ensure that the browser window sizes appropriately when they
log in. I'm using this right now:

<HEAD>
<title>My Login Page</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script type="text/javascript">
{window.resizeTo(828,732)}
</script>
</HEAD>


Since you are using a lot of IE specific items already, I assume your
intranet is IE only. If it is, then you can open a new window, the size
you want, with the parameters you want, and then close the original
window with window.close(). To get IE to allow you to close a window
that you didn't open with script, set the original window's .opener
property to anything you like and then it will be close-able by script.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #3

P: n/a
jef wrote:
Oops... the rest of the post got chopped off.

My existing solution is funky because it only works if the user has the
default toolbar/menubar configuration of IE. I need a way to force the
window to resize based on the content being 800x600 regardless of the
menubar/toolbar height.


Have a poke around here and see if something suits:

<URL:http://www.quirksmode.org/viewport/compatibility.html>

clientWidth/Height may figure in the solution.

--
Rob
Jul 23 '05 #4

P: n/a
jef wrote:
I have an Intranet application that is targeted to IE browsers only.
It is also designed explicitly to fit an 800x600 window.


You should rather change that design, but this should help you for
the moment:

function resizeCanvas(nWidth, nHeight) {
var nDX, nDY, sMode, oCanvasContainer;
if ((sMode = document.compatMode) && sMode == "CSS1Compat") {
oCanvasContainer = document.documentElement;
}
else {
oCanvasContainer = document.body;
}
if (oCanvasContainer) {
nDX = nWidth - oCanvasContainer.clientWidth;
nDY = nHeight - oCanvasContainer.clientHeight;
if (!isNaN(nDX) && !isNaN(nDY) && window.resizeBy) {
window.resizeBy(nDX, nDY);
}
}
}
onload = function() {
resizeCanvas(800, 600);
}

ciao, dhgm
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.