Results 1 to 6 of 6

Thread: Full-Screen Pop-Up.

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Full-Screen Pop-Up.

    I want a link on my page that opens a full screen pop-up window (with no status bar, address bar etc).
    How easy is this to do?

  2. #2
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    You should try to stay away from altering the persons browser windows.

    but it is relatively easy.

    Here's the code for the buddy list button you see up top:
    Code:
    <a href="#" onclick="window.open('URL',
    'TARGET','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,
    resizable=yes,width=100&#37;,height=100%'); return false;"></a>
    Modified.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,161
    Thanks
    44
    Thanked 3,236 Times in 3,197 Posts
    Blog Entries
    12

    Default

    That won't work and, it really cannot reliably be done. This is close but has some fixable and some not fixable problems:

    Code:
    <a href="http://www.google.com/" onclick="window.open(this.href, 
    '','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,\
    top=0,left=0,width='+screen.availWidth+',height='+screen.availHeight); return false;">G</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    screen.availWidth/height varies between browsers. In IE, the height overlaps the actual screen height.
    - Mike

  5. #5
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I see...
    I didn't really expect it to, but i had thought JS could use percents like that.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,161
    Thanks
    44
    Thanked 3,236 Times in 3,197 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by mburt View Post
    screen.availWidth/height varies between browsers. In IE, the height overlaps the actual screen height.
    Quote Originally Posted by boxxertrumps View Post
    I see...
    I didn't really expect it to, but i had thought JS could use percents like that.
    Yeah, that was mostly what I meant by the fixable part. The thing about IE and screen.availWidth/Height is that IE calculates that before it decides what chrome to assign to the window. So, it adds the chrome (title and scroll bars, etc.) onto those dimensions.

    Now, you cannot access the window size across domains but, if you are only launching your own page:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    function winopen(url){
    var h=screen.availHeight, w=screen.availWidth;
    var win=window.open(url,'','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,top=0,left=0,width='+w+',height='+h);
    try{
    win.resizeTo(w,h);
    }
    catch(e){
    }
    return false;
    }
    </script>
    </head>
    <body>
    <a href="some.htm" onclick="return winopen(this.href);">G</a>
    </body>
    </html>
    will work out. Legacy browsers will barf on try/catch. There are ways to prevent that but, if this is only done locally to open a local page, or with pages on the same domain, it really isn't needed:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    function winopen(url){
    var h=screen.availHeight, w=screen.availWidth;
    var win=window.open(url,'','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,top=0,left=0,width='+w+',height='+h);
    win.resizeTo(w,h);
    return false;
    }
    </script>
    </head>
    <body>
    <a href="some.htm" onclick="return winopen(this.href);">G</a>
    </body>
    </html>
    Last edited by jscheuer1; 04-22-2007 at 03:00 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •