<html> |
<head> |
<meta http-equiv= "Content-Type" content= "text/html; charset=gb2312" > |
<title>按指定要求打开的窗口</title> |
<script language= "javascript" > |
<!-- |
function anxia(t, l, w, h) // 函数: 打开新的窗口 |
{ |
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来打开新窗口 |
} |
//--> |
</script> |
</head> |
<body> |
<center> |
<h1>按指定要求打开的窗口</h1> |
<hr> |
<br> |
<form name= "biaodan" > |
<h4>打开自己设定打开浏览器窗口的</h4> |
<h4>高度/宽度/离上边的距离/离左边的距离/</h4> |
离上边的距离: |
<input type= "text" name= "top" /> |
像素<br/> |
<br/> |
离左边的距离: |
<input type= "text" name= "left" /> |
像素<br/> |
<br/> |
打开宽度: |
<input type= "text" name= "width" /> |
像素<br/> |
<br/> |
打开高度: |
<input type= "text" name= "height" /> |
像素<br/> |
<br/> |
<!-- 为按钮的onclick绑定anxia函数 --> |
<input type= "button" value= "打开网页" onClick= "anxia(this.form.top.value,this.form.left.value,this.form.width.value,this.form.height.value)" /> |
</form> |
</center> |
</body> |
</html> |