Resizing A Viewers Browswer Window
Posted: Thu Feb 20, 2003 1:50 pm
<script>
window.resizeTo(600,800);
</SCRIPT>
<script LANGUAGE="javascript">
var width = screen.width
var height = screen.height
document.write("<BODY onUnload=window.resizeTo("+width+ "," +height+")>")
</SCRIPT>
in this code you just need to change the numbers 600,800 to the size you want. make sure it is most likely to be used by your viewers
and then place this scripts just as they are here right after the first body tag on your web page anywere else will cause it not to work with out errors so it needs to be the first thing in between the body tags and before any content.
if you look at the script you see it is not telling the type of script for the first one. LEAVE IT THAT WAY if you make it say what type of script it is. it will not work.
the second one is re writing the body tag so it needs to be after the body tag to see it. and it just tells it to put the broswer back to the size it was before you changed it. when the viewer closes you page.
want to see it in action?
http://www.angelfire.lycos.com/tx5/rovingc...agentsongs.html
and click on the song of your choice if you dont have the msagents dont worry it will still change the size from your large one to the 600 x 800 size
and then back again when you leave. so not having the agents is not a big deal when you just want to see the code above work. just set your screen to a larger size then 600 x 800 because that is what i change it too.
enjoy
Archived topic from Iceteks, old topic ID:304, old post ID:1502
window.resizeTo(600,800);
</SCRIPT>
<script LANGUAGE="javascript">
var width = screen.width
var height = screen.height
document.write("<BODY onUnload=window.resizeTo("+width+ "," +height+")>")
</SCRIPT>
in this code you just need to change the numbers 600,800 to the size you want. make sure it is most likely to be used by your viewers
and then place this scripts just as they are here right after the first body tag on your web page anywere else will cause it not to work with out errors so it needs to be the first thing in between the body tags and before any content.
if you look at the script you see it is not telling the type of script for the first one. LEAVE IT THAT WAY if you make it say what type of script it is. it will not work.
the second one is re writing the body tag so it needs to be after the body tag to see it. and it just tells it to put the broswer back to the size it was before you changed it. when the viewer closes you page.
want to see it in action?
http://www.angelfire.lycos.com/tx5/rovingc...agentsongs.html
and click on the song of your choice if you dont have the msagents dont worry it will still change the size from your large one to the 600 x 800 size
and then back again when you leave. so not having the agents is not a big deal when you just want to see the code above work. just set your screen to a larger size then 600 x 800 because that is what i change it too.
enjoy
Archived topic from Iceteks, old topic ID:304, old post ID:1502