Results 1 to 3 of 3

Thread: new window, set to max width/height?

  1. #1
    Join Date
    Mar 2007
    Location
    Scotland
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default new window, set to max width/height?

    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1032,height=746,left = 387,top = 259');");
    }

    Im using the above script on my website [visitors click button and it opens a window with my website on it]. Does anyone know how to set a standard so that the page resizes to fit their window to avoid any problems with different screen resolutions?

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Aidanx View Post
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1032,height=746,left = 387,top = 259');");
    }

    Im using the above script on my website
    Ick.

    Assuming you don't need to reference the window in code (which that function makes rather difficult anyway, at least use:

    Code:
    function popUp(uri) {
        window.open(uri, '_blank', 'scrollbars,resizable');
    }
    [visitors click button and it opens a window with my website on it].
    That's the idea, but not necessarily the reality. You are aware that some visitors will indiscriminately disable pop-ups entirely, or those pop-ups will open as tabs ignoring your specified size and location.

    Does anyone know how to set a standard so that the page resizes to fit their window to avoid any problems with different screen resolutions?
    Ensure that the window is scrollable and resizeable, and don't specify any dimensions or position. Allow the window manager to do its job and create windows in a predictable or desirable manner. Better yet, don't create a new window at all, if you can help it.
    Mike

  3. #3
    Join Date
    Mar 2007
    Location
    Scotland
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thats just the script, the actual code was involving a form that being the twat I am, I managed to delete during a clean out but I can rewrite it.

    And if I leave the height and width blank, then it doesnt even pop-up.

Bookmarks

Posting Permissions

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