ljl 发表于 2007-4-27 11:12:30

***综合类***自定义跳窗的高、宽及相对位置

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<script language="javascript">
<!-- begin
function popuppage(l, t, w, h) {
var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes" +
",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;

var url = "link.htm";
popup = window.open(url,"menupopup",windowprops);
}
//end -->
</script>


第二步:把如下代码加入到<body>区域中

<center>
<table>
<tr>

<td>
<form name=popupform>
          <pre>自己设定弹出窗口的大小及位置<br>
左边距:<input type=text name=left size=2 maxlength=4> 象素
石边距:<input type=text name=top size=2 maxlength=4> 象素

窗口宽:<input type=text name=width size=2 maxlength=4> 象素
窗口高:<input type=text name=height size=2 maxlength=4> 象素
</pre>
          <center>
            <input type=button value="打开窗口" onclick="popuppage(this.form.left.value, this.form.top.value, this.form.width.value, this.form.height.value)">
</center>

</form>
</td>

</tr>
</table>
</center>
   <input type="button" name="submit" value="返回









--------------------------------------

http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页: [1]
查看完整版本: ***综合类***自定义跳窗的高、宽及相对位置