473,414 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Resize browser window... why such a pain?

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
4 1823
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Weng kin | last post by:
Hi everyone, I have a problem trying to load an image without the image resizing itself to fit into the window. My simple javascript is as follows: function viewImage(filename) { features =...
4
by: David Logan | last post by:
Hello, I am trying to open a window with a graphic in it and have the window be exactly the correct size of the image. Is there anyway to do this that will work on any browser on any OS???? ...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
14
by: franz | last post by:
hallo everyone, i have a popup window 500x400px centered in the middle of the screen and inside it there's a mini-photogallery. what i want is to click on a thumbnail and open in the same window a...
69
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow...
1
by: piscesabhi | last post by:
Is there a way to auto resize the website, when using different browsers? I was using this javascript earlier but i don't want to specify dimensions........i would like it to automatically adjust...
5
by: Doug Gunnoe | last post by:
I'm considering resizing a div onload to better match the screen width of the user. Easy enough, however it seems that I have read in this group that there are potential problems with this,...
0
by: msoliver | last post by:
Issue: I want resize handlers within an iframe to be called when the main window changes size. Alternatively, I'd like to know how to propagate a resize event handled by the main window to iframe...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.