js打开新窗口多种方法与代码

发布时间:2019-10-25编辑:脚本学堂
分享下js打开新窗口的方法,很全面的js新开窗口方法与代码,感兴趣的朋友参考下。
6,打开即全屏
 

复制代码 代码示例:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>js打开新窗口方法代码收集 - 脚本学堂 -http://www.jbxue</title>
<link href="index.css" rel="stylesheet"type="text/css">
<script language="JavaScript"type="text/JavaScript">
<!--
function MachakFull(Ie,other){
x=screen.availWidth;
y=screen.availHeight;
target =parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,navigator.appVersion.length));
if((navigator.appVersion.indexOf("Mac")!=-1)&&(navigator.userAgent.indexOf("MSIE")!=-1)&&(parseInt(navigator.appVersion)==4))
window.open(other,"sub",'scrollbars=yes');
if (target >= 4){
if (navigator.appName=="Netscape"){
varMachakFull=window.open(other,"MachakFull",'scrollbars=yes','width='+x+',height='+y+',top=0,left=0');
MachakFull.moveTo(0,0);
MachakFull.resizeTo(x,y);}
if (navigator.appName=="Microsoft Internet Explorer")
window.open(Ie,"MachakFull","fullscreen=yes");
}
else window.open(other,"sub",'scrollbars=yes');
}

function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue =false;
for (i=0; i<(args.length-1); i+=2)eval_r(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<body bgcolor="#3366CC" SCROLL=NOonload="MachakFull('/bbs/','')">
<script>
window.open('/','','fullscreen=1');
window.close();
</script>

7,网页对话框
 

复制代码 代码示例:
<script>
window.onload=function(){
varfeatures='status:0;dialogWidth:470px;dialogHeight:470px;dialogTop:100px;dialogLeft:100px;resizable:0;scroll:0;center:1';
showModelessDialog("http://www.jbxue/",window,features);
}
function show(laysn)
{
var obj;
obj=laysn.style;
obj.visibility='visible';
}
function hidden(laysn)
{
var obj;
obj=laysn.style;
obj.visibility='hidden';
}
</script>

8,子窗口打开,关闭父窗口
 

复制代码 代码示例:
<script>
window.open('http://www.jb200.com/','','width=790,height=590');
window.opener=null;
window.close();
</script>