Jump to content
xisto Community
Sign in to follow this  
cyber_electrons

How To Restrict The Size Of An Internet Explorer When A Page Opens?

Recommended Posts

How to restrict the size of an internet explorer when a page opens?I need to know the code to make the window resize itself and without using popups. I do not want the person viewing the website to resize the window just for viewing it comfortably. It wuold be best for the windoew to resize itself.The size I need is 1024 ? 768 for your information.If you can construct the code, that'd be great.Thnks.

Share this post


Link to post
Share on other sites
<script>window.resizeTo(1024,768);</script>

Do keep in mind, though, that not all browsers allow for every single JavaScript action to occur. For example, in Firefox and Opera you can limit what JavaScript can do, and one of those things is preventing JavaScript from resizing the window—users can get annoyed when their desires are not met, so they turn these things off.

Share this post


Link to post
Share on other sites

Just for clarification, do I put it in <body> </body>?

The header (<head>) is the better place to put it, and you'll need it to occur on onLoad:
<script>
function init() {
window.resizeTo(1024,768);
}
window.onload = init;
</script>

 

Also is it possible to control the delay to when it resizes?

Yes, if you need it to occur shortly after the page has loaded, modify the above function to include a timeout.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.