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 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open New Window From Link!

    The following code opens a new window when a user clicks the hyperlink:

    <script language="JavaScript">
    function openNewWindow(){
    open("Options.asp","popup")
    }
    </script>
    <body>
    <a href="javascript:void(0)" onClick="openNewWindow()">Click</a>


    The above does open a new window when the link is clicked but the window gets opened in the "Restored" state. How do I make the window open in the "Maximized" state?

    Thanks,

    Arpan

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,472
    Thanks
    0
    Thanked 634 Times in 624 Posts
    Calculate the size of the screen and add the appropriate width and height parms to open it to that size. My Popup windows tutorial series at http://javascript.about.com/od/popupwindows/ shows how to assign a size to the popup as well as how to set the position on the screen where it is to appear. screen.availWidth and screen.availHeight provide you with the current screen resolution (less the start bar and any other fixed control bars)
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New Coder
    Join Date
    Sep 2002
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Stephen, for your help.

    I had been to the URL you had cited but couldn't find a solution to my question. I know how to open a new window using JavaScript, control its dimensions, position etc.. but I want the new window to open in the "Maximized" state & not in the "Restored" state. Even if I get the screen width & height using screen.availWidth & screen.availHeight respectively, the new window covers the entire screen (as a normal maximized browser window does) but the window doesn't open in the "Maximized" state. Even the "Maximize" button remains disabled!

    I have tried other options as well but none of them cater to my needs!

    I guess I have clarified myself as precisely as possible!

    Thanks once again,

    Regards,

    Arpan

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    You can't open popup windows in "Maximized" state.

  • #5
    Registered User
    Join Date
    Oct 2004
    Posts
    592
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by glenngv
    You can't open popup windows in "Maximized" state.
    But we can open it in fullscreen state.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Quote Originally Posted by iota
    But we can open it in fullscreen state.
    But not anymore in IE/XP SP2.
    And even then, arpan_de specifically asked for "Maximized" state.


  •  

    Posting Permissions

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