Click to See Complete Forum and Search --> : sript request


aalowe9
08-21-2003, 10:19 AM
could some1 please please help me, i have the front page of my site and i want the window to resize to 700 x 500 when the page loads (and also make it chromeless if possible, but thats not compulsery) i dont know javascript at all so if any1 could post the code i need to put in the html i would really really appreciate it. tyvm.

AdamGundry
08-21-2003, 10:48 AM
The basic code to do this is as follows (replaces your <body> tag):
<body onload="window.resizeTo(700, 500)">

Be aware of the following points, however:[list=1] This will fail for users with JS disabled (approx 13% of web users)
This will also fail if it causes the window to be bigger than the screen (i.e. on 640*480)
Your page should use a flowing design, so it works on any resolution
[/list=1]
Adam

aalowe9
08-21-2003, 10:51 AM
thatnks lot

aalowe9
08-21-2003, 11:11 AM
one more thing, how do i rewrite that line to make the window scollbar-less and stop resizing?

AdamGundry
08-21-2003, 01:19 PM
You can remove the scrollbars by adding this to the <body> tag:
style="overflow: hidden"

It is not really possible to stop resizing, as you can't control the browser chrome very much (except for the chromeless window IE hack, which requires a popup window and only works in some versions of IE). Depending on what you want to do, it might be better to create an <iframe> with your content, which can be prevented from resizing.

Adam