Results 1 to 8 of 8

Thread: JS function for maximizing a new window

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question JS function for maximizing a new window

    I wish to open a new window from a simple link in HTML which must be maximized. Does any of you have a function which includes this?

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Code:
    function openNewWindow(sPagename) 
    {
    	var winName = "";
    	var winFeatures = "width=" + (screen.availWidth - 10) + ",height=" + (screen.availHeight - 30) + ",top=0,left=0,scrollbars";
    	var winURL = "http://localhost/" + sPagename 
    	var w;
    	w = window.open(winURL,winName,winFeatures);
    }
    this will open a new window that fills the screen.
    i have never found out how to make the window maximised.

  3. #3
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    Originally posted by DeadEyes
    i have never found out how to make the window maximised.
    I always hate it when a new window fills my screen entirely, hiding the min/max controls and the taskbar. Popup windows should never make it harder for users to use their computer.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    I agree, bu then I didn't express myself clearly. What I wish is a new window which fills the entire screen area, including toolbars, buttons etc.

  5. #5
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    riis I think you've missed the point. the idea is to put the window
    in a maximised state (like when you click that little box in the top right corner) not to hide any controls

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Is it possible to include the toolbar and the status line?

  7. #7
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Yes is part of features:
    Code:
    var winFeatures = "width=500,height=500,top=0,left=0,scrollbars,status,toolbar";

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Re: JS function for maximizing a new window

    How do I allow that the user can scale the window size? Now it is fixed and that is not elegant. I have used this code:

    window.open ("http://www.xxxxx.com/default.aspx",
    "mywindow","location=0,status=1,width=" + (screen.availWidth - 10) + ",height=" + (screen.availHeight - 30) + ",top=0,left=0";

Posting Permissions

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



Click Here to Expand Forum to Full Width