Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Location
    UK
    Posts
    207
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Maximum size of browser window...

    I am trying to make a page which detects the current size of the browser window and changes it to 800, 600 if it was originally bigger.

    here's the code i currently have which just makes it go to 800, 600 whatever.

    Code:
    <head>
    <script>
    function changeScreenSize(w,h)
    {
    window.resizeTo( w,h )
    }
    </script>
    
    <title>Test Page</title>
    
    </head>
    <body onload="changeScreenSize(800,600)">
    Any ideas?

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Say goodbye to all of your visitors who will be driven away from your site.

    I'm not sure, it should work... but why do you want to do this?

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Location
    UK
    Posts
    207
    Thanks
    6
    Thanked 2 Times in 2 Posts
    why would they be driven away?

    the code i've shown above does work but it enlarges as well as reduces the size of the window... i only want it to reduce large windows.

  • #4
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    945
    Thanks
    0
    Thanked 129 Times in 128 Posts
    If visitors is driven away, depends on which windows you resize;

    If you e.g. shows pictures in a popup and then resizes that window to fit the picture it would normally be no problem.

    But do not use resizing on any ordinary pages.

    It is up the viewer to choose the size of the window in which they see a page, and therefore you shouldnt force a page into your choice of dimensions.

    If you do that they will mostly leave the page.

    No one like to be forced to anything, and dimenions of a viewed page is no exception.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •