Results 1 to 5 of 5

Thread: Plain Window

  1. #1

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    Hi, this is sort of three questions related to one another:

    1. How can I load a window with no Menu, Tool and Address bars you know a bit like those banner windows where it's just the window with the content.

    2. How can I load a plain window with just the Toolbar

    3. How can I load a plain window with just the Menubar

    !!! THANKS IN ADVANCE !!!

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi Ramandeep,

    I have created a mini utility for you which should generate the script for u.

    Hope this helps

    Code:
    <HTML>
    <HEAD>
    <TITLE>Dan's Window Creator</TITLE>
    <script>
    function CreateWin()
    {
    
    
    var sbar, abar, tbar, mbar;
    var filename;
    var w, h, l, t;
    
    filename=document.form1.txtUrl.value;
    
    w=document.form1.txtWidth.value;
    h=document.form1.txtHeight.value;
    
    l=document.form1.txtLeft.value;
    t=document.form1.txtTop.value;
    
    
    if (document.form1.chkStatusBar.checked==true) 
    	sbar="yes";
    else
    	sbar="no";
    
    
    if (document.form1.chkAddressBar.checked==true)
    	abar="yes";
    else
    	abar="no";
    
    if (document.form1.chkToolbar.checked==true) 
    	tbar="yes";
    else
    	tbar="no";
    
    if (document.form1.chkMenu.checked==true)
    	mbar="yes";
    else
    	mbar="no";
    
    var settings="width=" + w + ", height=" + h + ", top=" + t + ", left=" + l + ", status=" + sbar +  ", toolbar=" + tbar + ", location=" + abar + ", menubar=" + mbar;
    
    document.form1.txtCode.value="<html>\n<head>\n<title>Dan's Window Creator</title>\n<script>\nfunction openit(){\ndocument.open('"  + filename + "', '' ,'" + settings + "')\n}";
    document.form1.txtCode.value=document.form1.txtCode.value + "\n<\/script>\n<\/head>\n<body>\n<center>\n<h1>Create Window<\/h1>\n<br>\n<br>\n<form><input type=button value=Create onclick='javascript:openit()'>\n<\/form>\n<\/center>\n<\/body>\n<\/html>";
    
    
    
    //alert (settings);
    window.open( filename ,"", settings);
    
    }
    </script>
    </HEAD>
    <BODY bgcolor="#ffffff">
    <H2 align=center>Dan's Popup window creator</H2>
    <P align=center>&nbsp;</P>
    <form name="form1" method="post" action="">
      <table width="100%" border="0" bordercolor="#ffffff" bgcolor="#99ccff" cellpadding="2" cellspacing="2">
        <tr bgcolor="#99ffff"> 
          <td> 
            <input name="chkMenu" type=checkbox>
            Menu</td>
          <td> 
            <input  name="chkToolbar" type=checkbox>
            Toolbar </td>
        </tr>
        <tr bgcolor="#99ffff"> 
          <td> 
            <input name="chkAddressBar" type=checkbox>
            Address Bar </td>
          <td> 
            <input  name="chkStatusBar" type=checkbox>
            Status Bar </td>
        </tr>
        <tr bgcolor="#99ffff"> 
          <td>Width 
            <input name="txtWidth" value="200" 
         >
          </td>
          <td>Height 
            <input name="txtHeight" value="200" 
         >
          </td>
        </tr>
        <tr bgcolor="#99ffff"> 
          <td>Left 
            <input name="txtLeft" value="300" 
         >
          </td>
          <td>Top 
            <input name="txtTop" value="300" 
         >
          </td>
        </tr>
        <tr bgcolor="#99ffff"> 
          <td colspan="2">URL 
            <input name="txtUrl" value="about:blank" >
          </td>
        </tr>
        <tr bgcolor="#99ffff">
          <td colspan="2"> 
            <div align="center">
              <input  name=button1 type=button value="Create Window" onClick = "JavaScript:CreateWin()">
            </div>
          </td>
        </tr>
        <tr bgcolor="#99ffff"> 
          <td colspan="2">
          <DIV align=center><TEXTAREA cols=100 name=txtCode rows=10 style="LEFT: 4px; TOP: 3px"></TEXTAREA>&nbsp;</DIV>
          <DIV align=center>Just copy and paste the code in note pad and&nbsp;save 
          it as a htm/l file.&nbsp;</DIV>
          </td>
        </tr>
      </table>
      
    </form>
    
    </BODY>
    </HTML>
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    I think there is a much easier way to do this.

    Code:
    <script>
    windowa=window.open("http://yoursite.com/yourpage.html","newwindow","scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=yes,resizable=yes,width=310,height=200")
    windowa.focus();
    </script>
    You can change the yes/no attributes to suit your needs. Also, there can be no carriage returns in the window.open(), so make sure that it is all on one line.
    Alcohol & calculus don't mix.
    Never drink & derive.

  4. #4
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    And, there is a space character in the height attribute that I can't seem to get rid of, so take that out too
    Alcohol & calculus don't mix.
    Never drink & derive.

  5. #5

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    Thanks guys that’s a great help!!! I did also find the code in a site that I visited yesterday but this will save me time scrimmaging through all the rest of the HTML and JAVA SCRIPT it has in it.

    !!! Thanks Once Again !!!

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