介绍几种很不错的新开窗口的方法
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a.js:link{ color: #FF0000; text-decoration: none; line-height: 120% }
a.js:visited{ color: #FF0000; text-decoration: none; line-height: 120% }
a.js:hover{ color: #FF3300; text-decoration: underline; line-height: 120% }
a.js:active{ color: #FF3300; text-decoration: underline; line-height: 120% }
-->
</style>
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
Leftposition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+Leftposition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
</script>
<script language="javascript">
function movetocenter(w,h){
Leftposition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
zz=window.open('red.htm','','fullscreen');
zz.resizeTo(w,h);
zz.moveTo(Leftposition,TopPosition);
}
</script>
<script>
<!--
function fullwin(targeturl){
window.open(targeturl,"","fullscreen,scrollbars")
}
//-->
</script>
</head>
<body bgcolor="#c2c2c9" text="#000000" leftmargin="0" topmargin="0">
<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
<table width="80%" border="0" cellspacing="0" cellpadding="0" height="80%" align="center">
<tr>
<td align="center"> <a href="#" onclick="closes.Click();"><img src="/images/jsbg.gif" width="233" height="104" border="0"></a>
<br>
<font color="#FF0000">要正确浏览下列效果,请使用IE浏览器</font> <br>
<p><a href="red.htm" onclick="NewWindow(this.href,'opwd','400','300','no','center');return false" onfocus="this.blur()">新开窗口,指定大小,自动屏幕居中</a>
</p>
<p><a href="#" onclick="movetocenter(400,400)">新开无边框窗口,指定大小,自动屏幕居中,最好与“关闭窗口”合用</a>
</p>
<p><a href="#" onClick="fullwin('red.htm')">新开全屏窗口,最好与“关闭窗口”合用,要不只有'Alt+F4'关闭窗口了</a></p>
</td>
</tr>
</table>
</body>
</html>
>>
内容搜索
相关文章
推荐文章


热点资讯
专题栏目

