今天下午3点中日开战了:带出窗口后关闭原来的窗口的代码

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 02:36:22
我要的效果是,当别人点击一个链接之后在新窗口打开,并且关闭原来的窗口
如果我要加在点击一个图片后弹出窗口,然后关闭原来的窗口要怎么弄呢?

<HTML>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>
<body onload="Wopen()">
<script language="Javascript">
<!--
var swidth=screen.width;//这句是关键
var sheight=screen.height;//这句也是关键
function Wopen(){
window.open("要打开的地址","","toolbar=no,width="+swidth+",height="+sheight+",left=0,top=0,resizable=yes,status=yes,scrollbars=yes,");
}
window.opener=null
window.close()
// -->
</script>
</body>
</HTML>