Forum Moderators: open
I might, pull the window.onload on it, in case it should wait till the content was loaded - but there probably shouldn't be any reason to pull up the onload handler, since the window could be resized, before the content is loaded without problems.
<script type="text/javascript">
window.onload=function(){winalign();}
function winalign(){window.resizeBy(10,10);}
</script>
code desc. for newly js interested persons that might drop by:
- window.onload=function(){} waits for the document's content to load - and then executes the script.
- window.resizeBy(x,y) for specifying offset between current width/height and the new width/height.
- window.resizeTo(x,y) not relevant here - but it defines the new width/height of the window.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title>No title</title>
<script type="text/javascript">
window.onload=function(){winalign();}
function winalign(){window.resizeBy(10,10);}
</script>
</head>
<body>
Something...
</body></html>
Or:
- make a winalign.js file with this content:
window.onload=function(){winalign();}
function winalign(){window.resizeBy(10,10);}
- And heres the other test file:
... (same top part as in the previous) ...
<script type="text/javascript" src="winalign.js"></script>
</head>
<body>
Something...
</body></html>
Edit: The external script name, doesn't need to be named the same as the function of course ... and could also have some other js functions in it...
Edit #2: You could also place the script section, just before the end of the document...
...
<body>
Something...
<script type="text/javascript">window.resizeBy(10,10);</script>
</body></html>
^ But, if you use this instead of onload handler: The html document would have been read into the browser ... however it might not have been fully rendered - and images might not be loaded yet...
function winalign(){
window.resizeBy(-10,-10);
setTimeout("window.resizeBy(10,10);",200);
}
- If that doesn't help the script working in your FF try: (sorry if the menu names doesn't fit exactly ... danish edition of FF here): Functions -> Settings -> The tab "Contents" (globe icon) -> "Advanced javascript" settings buttom -> and check "Allow sites to relocate and resize existing windows"...