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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Maximising new window in javascript

  • 30-05-2007 3:05pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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