您的位置:首页 > Web前端 > JavaScript

JS window对象指定大小页面

2015-09-21 17:09 507 查看
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档</title>
<script language="javascript">
function openwindow(){
if(window.screen.width == 1024 && window.screen.height == 768){
open("register.html","注册窗口","toolbars = 0,location=0,statusbars=0,menubars=0,width=700,height=550,scrollbars=1");
}
else{
window.alert("请设置分辨率为1024X768,然后再打开");
}
}
function closewindow(){
if(window.confirm("您确认要退出系统吗?"))
window.close();
}
</script>
<style type="text/css">
body{backgroud-color:#cccccc;}
</style>
</head>

<body>
<table border="0" align="center" bgcolor="#ffffff">
<tr>
<td><input type="button" name="regButton" value="进入" onClick="openwindow()">
<input type="button" name="exitButton" value="退出" onClick="closewindow()"></td>
</tr>
</table>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: