|
-
Feb 7th, 2002, 04:49 PM
#1
Thread Starter
Fanatic Member
window size
Hi,
hopefully a simple question!
How do I set the size of the IE window when someone goes to my website?
Thanks
Nick
-
Feb 7th, 2002, 09:28 PM
#2
Stuck in the 80s
this can be done quite simply using JavaScript:
Code:
<script>
// Coded by Kristopher <[email protected]>
top.window.moveTo(20,20);
if (document.all) {
top.window.resizeTo(400,400);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
This will set the browsers as follows: Left - 20, Top - 20, Width - 400, and Height - 400.
This can be customized as follows:
Code:
<script>
// Coded by Kristopher <[email protected]>
wtop = 20; // replace with desired top
wleft = 20; // replace with desired left
wwidth = 400; // replace with desired width
wheight = 400; // replace with desired height
top.window.moveTo(wtop,wleft);
if (document.all) {
top.window.resizeTo(wwidth,wheight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
</script>
So if you ever want to change the dimensions, it's easy to customize.
Hope this helps!
-
Feb 7th, 2002, 09:29 PM
#3
Stuck in the 80s
I neglected to mention (incase you don't know) that this should go between the head tags:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|