有谁知道.如何让html链接到另一个页面时.链接的页面最小化显示?

有谁知道.如何让html链接到另一个页面时.链接的页面最小化显示?,第1张

使用window.open window.open ("page.html", "newwindow", "height=100, width=400, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=100,left=300")

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>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/7048636.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-01
下一篇2023-04-01

发表评论

登录后才能评论

评论列表(0条)

    保存