Results 1 to 3 of 3

Thread: pop up window

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    Disney Land
    Posts
    190

    pop up window

    i want that when i click on enter a window will pop out with on it's title no status bar nor menus no icons, nothing only the title

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Code:
    <html>
    <head>
    <title>Untitled</title>
    <script language="JavaScript" type="text/javascript">
    <!--
    function popup(){
    window.open('test.html', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=200');
    }
    //-->
    </script>
    
    </head>
    <body>
    <input type="button" value="Enter" onclick="popup()">
    </body>
    </html>
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I use this function when using JavaScript to open links:

    Code:
    <script type="text/javascript"><!--
      //If possible opens a window and returns false, else returns true
      function openWindow(windowURI, windowWidth, windowHeight) {
        /*YOU CAN EDIT THESE VALUES*/
        var windowConfig = 'toolbar=no, ';
        windowConfig += 'menubar=no, ';
        windowConfig += 'scrollbars=no, ';
        windowConfig += 'resizable=yes, ';
        windowConfig += 'location=no, ';
        windowConfig += 'directories=no, ';
        windowConfig += 'status=no';
        /*END EDITING*/
    
        //Set the window width/height if present
        if (windowWidth != null) windowConfig += ', width=' + windowWidth;
        if (windowHeight != null) windowConfig += ', width=' + windowHeight;
        //Default return value is true, in case browser doesn't support window.open
        var returnValue = true;
        //Open the window with the above config if avaliable
        if (window.open) {
          window.open(windowURI, '_blank', config = windowConfig);
          //Return false to stop non-JS link working
          returnValue = false;
        }
        //Return false so that the link will be surpressed
        return returnValue;
      } 
    //--></script>
    and then for the actual link, something like this:

    Code:
      <a href="THEPAGE.htm" onclick="return openWindow(this.href);">CLICK ME!</a>
    That way if the user don't have JS (or the Window.open function) it will just open in the same window.

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