Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Maximising new window in javascript

Options
  • 30-05-2007 4:05pm
    #1
    Registered Users Posts: 91 ✭✭


    I need to open a new window in Javascript and when I do, I need to open this new window with the same resolution that the viewer is looking at.

    eg 1024x768 & 800x600

    also need to have location, status, toolbar, scrollbar and all enabled

    any ideas if there is a function for this??


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    You use the window.open() function to open a new window, and then you can use the below code to "maximise" it.
    window.moveTo(0,0);
    window.resizeTo(screen.width,screen.height);
    
    The problem here is that it won't be "docked". If the window is already maximised, then it will actually undock it.

    Consider whether you need to do this. Doing this kind of thing is massively irritating for users. If a website ever attempts to resize the browser, I just close it and don't look back.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    seamus wrote:
    If a website ever attempts to resize the browser, I just close it and don't look back.

    Yeah, its generally frowned upon in web dev. Sites that do this aren't really trust worthy.


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    seamus wrote:
    If a website ever attempts to resize the browser, I just close it and don't look back.
    Likewise. I have a large widescreen monitor and don't use the full width of the screen. I normally have something else open beside it. As far as I'm concerned my browser window dimensions are mine and I won't revisit your site if you mess with them.


Advertisement