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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Newbie Needing Help (Exit Window)

    When you open and then close Exit.html it should open up ExitWindow.html and show the window with sponsors. No scroll bar and no resizing. It's not working correctly. Also I was wondering if there was a shorter code to get the scroll bar and no resizing on.

    Exit.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtmll/DTD/xhtmll-strict.dtd">
    <html xmls="http://www.w3.org/1999/xhtml">
    <head>
    <title>Exit</title>
    <meta http-equiv-"content-type" content="text/html;
    charset=iso-8859-1" />
    <script type="text/javascript">
    /* <![CDATA[ */
    /*
    Stephanie
    February 18th, 2009
    Case Project 4-2
    */
    /* ]]> */
    </script>
    </head>

    <body onunload="window.open('ExitWindow.html')">
    <h1>You may now exit this window.</h1>
    </body>
    </html>

    ExitWindow.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtmll/DTD/xhtmll-strict.dtd">
    <html xmls="http://www.w3.org/1999/xhtml">
    <head>
    <title>Exit Window</title>
    <meta http-equiv-"content-type" content="text/html;
    charset=iso-8859-1" />
    <script type="text/javascript">
    /* <![CDATA[ */
    /*
    Stephanie
    February 18th, 2009
    Case Project 4-2
    */
    /* ]]> */


    var partnerSite;
    function openLink(link) {
    var winWidth = screen.width;
    var winHeight = screen.height;
    var winOptions = "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no";
    winOptions += ",width=" + winWidth;
    winOptions += ",height=" + winHeight;
    partnerSite = window.open(link, "partnerSite", winOptions);
    partnerSite.focus();
    }

    </script>
    </head>
    <body>


    <h1>Thanks For Visiting!</h1>
    <p>Be sure to visit our partner Web sites:</p>
    <ul>
    <li><a href="http://www.steeleraddicts.com" onclick="openLink('http://www.steeleraddicts.com');">Steeler Addicts</a></li>
    <li><a href="http://www.steelers.com" onclick="openLink('http://www.steelers.com');">Pittsburgh Steelers</a></li>
    <li><a href="http://www.pensunderground.edu" onclick="openLink('http://www.pensunderground.com');">Pens Underground</a></li>
    <li><a href="http://www.pittsburghpenguins.com" onclick="openLink('http://www.pittsburghpenguins.com');">Pittsburgh Penguins</a></li>
    <li><a href="http://www.espn.com" onclick="openLink('http://www.espn.com');">ESPN</a></li>
    </ul>
    <input type="button" value="Close Window" onclick="window.close()" />
    </body>

    </html>
    This is the part I am talking about making smaller:

    var winWidth = screen.width;
    var winHeight = screen.height;
    var winOptions = "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no";
    winOptions += ",width=" + winWidth;
    winOptions += ",height=" + winHeight;
    partnerSite = window.open(link, "partnerSite", winOptions);

    Thanks so much!

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,447
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    You can't really make it *THAT* much smaller, so just turn it into a function, instead:
    Code:
    <head>
    <script language="JavaScript">
    function popup( )
    {
        var winOptions = "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,"
                            + "width=" + screen.width + ",height=" + screen.height;
    
        window.open("ExitWindow.html", "partnerSite", winOptions);
    }
    </script>
    </head>
    <body onUnload="popup( );">
    ...
    Hope you realize that this is indeed a *classic* popup, of exactly the kind that many people's popup blockers *WILL* block. Depends on how strict they have their settings.

    Oh...and I'm not sure screen.width and screen.height work for all browsers, but it won't hurt to try them.

  • #3
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So I stick that into ExitWindow.html? Sorry still trying to get a grasp of this stuff. Thanks you so much for the reply. I really appreciate it.


  •  

    Posting Permissions

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