Page 1 of 1

Resizing A Viewers Browswer Window

Posted: Thu Feb 20, 2003 1:50 pm
by rovingcowboy
<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 B)

Archived topic from Iceteks, old topic ID:304, old post ID:1502

Resizing A Viewers Browswer Window

Posted: Fri Feb 21, 2003 1:29 am
by Red Squirrel
cool, I think I'll have to impliment that on the photo gallery for when it opens a new window to view a picture, but I'd need to maximized it would be better though.


By the way I think I'll turn this section into general programming and not just C++ ;)

Archived topic from Iceteks, old topic ID:304, old post ID:1517

Resizing A Viewers Browswer Window

Posted: Fri Feb 21, 2003 8:18 pm
by Chris Vogel
Thank you.

But, I hate when people resize my browser window. :roflmao2: :roflmao2: :roflmao2:

Archived topic from Iceteks, old topic ID:304, old post ID:1519

Resizing A Viewers Browswer Window

Posted: Sat Feb 22, 2003 10:06 am
by rovingcowboy
but with this script i found it atleast puts it back to the same size you had it at so you dont get really mad :D

Archived topic from Iceteks, old topic ID:304, old post ID:1522

Resizing A Viewers Browswer Window

Posted: Sat Feb 22, 2003 8:25 pm
by Chris Vogel
That is good. I won't get too angry then.... :D

Archived topic from Iceteks, old topic ID:304, old post ID:1531