[JavaScript] js在指定的位置按指定的大小打开新窗口 →→→→→进入此内容的聊天室

来自 , 2019-07-27, 写在 JavaScript, 查看 98 次.
URL http://www.code666.cn/view/d67d8ab4
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <title>按指定要求打开的窗口</title>
  5. <script language="javascript">
  6. <!--
  7. function anxia(t, l, w, h)              // 函数: 打开新的窗口
  8. {
  9.         window.open("about:blank","可以改变大小的窗口","height="+h+",width="+ w +", top="+ t +",left="+ l +", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no,status=no")      // 调用window窗口对象的open来打开新窗口
  10. }
  11. //-->
  12. </script>
  13. </head>
  14. <body>
  15. <center>
  16.   <h1>按指定要求打开的窗口</h1>
  17.   <hr>
  18.   <br>
  19.   <form name="biaodan">
  20.     <h4>打开自己设定打开浏览器窗口的</h4>
  21.     <h4>高度/宽度/离上边的距离/离左边的距离/</h4>
  22.     离上边的距离:
  23.     <input type="text" name="top"/>
  24.     像素<br/>
  25.     <br/>
  26.     离左边的距离:
  27.     <input type="text" name="left"/>
  28.     像素<br/>
  29.     <br/>
  30.     打开宽度:
  31.     <input type="text" name="width"/>
  32.     像素<br/>
  33.     <br/>
  34.     打开高度:
  35.     <input type="text" name="height"/>
  36.     像素<br/>
  37.     <br/>
  38.     <!-- 为按钮的onclick绑定anxia函数 -->
  39.     <input type="button" value="打开网页" onClick="anxia(this.form.top.value,this.form.left.value,this.form.width.value,this.form.height.value)"/>
  40.   </form>
  41. </center>
  42. </body>
  43. </html>
  44.  

回复 "js在指定的位置按指定的大小打开新窗口"

这儿你可以回复上面这条便签

captcha