
height:page.html的高度
width:page.html的宽度
top:page.html距离屏幕顶部的距离
left:page.html距离屏幕左边的距离
top和left就是给page.html设定位置的
window.open() 方法
语法:window.open(pageurl,name,parameters)
window对象的open()方法用于创建一个新的窗口实例,新创建的窗口的外观由参数:parameters指定。新窗口中打开的文档由参数: pageurl指定。系统能够根据参数:name确定的名称访问该窗口。
真的不行,换句话,没有办法的。<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8">
<title>无标题文档</title>
<script type="text/javascript">
function isMinStatus() {
var isMin = false
if (window.outerWidth != undefined) {
isMin = window.outerWidth <= 160 &&window.outerHeight <= 27
}
else {
isMin = window.screenTop <-30000 &&window.screenLeft <-30000
}
return isMin
alert(111)
}
function notifyTeacher(){
alert('document.body.offsetTop:'+document.body.offsetTop+',document.body.offsetWidth:'+document.body.offsetWidth+',screen.availWidth:'+screen.availWidth+',top.screenTop:'+top.screenTop)
alert('window.screen.width:'+window.screen.width+',window.screen.height:'+window.screen.height+',window.screen.availWidth:'+window.screen.availWidth+',window.screen.availHeight:'+window.screen.availHeight)
alert(top.name)
alert(top.screenTop+'|'+top.screenLeft)
if(isMinStatus()){
window.focus()
}else{
document.focus()
}
}
</script>
</head>
<body onLoad="notifyTeacher()">
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)