大学IT网 - 最懂大学生的IT学习网站! QQ资料交流群:367606806
当前位置:大学IT网 > JavaScript技巧 > js打开新窗口的若干方法总结

js打开新窗口的若干方法总结(2)

关键词:javascriptjs打开窗口方法总结  阅读(1586) 赞(75)

[摘要]本文对js打开新窗口的方法进行了总结。


6,打开即全屏


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>js打开新窗口方法代码收集 - 大学IT网 - http://www.daxueit.com</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"){
   var MachakFull=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=NO onload="MachakFull('/bbs/','')">

<script>
window.open('/','','fullscreen=1');
window.close();
</script>


7,网页对话框

<script>
window.onload=function(){
var features='status:0;dialogWidth:470px;dialogHeight:470px;dialogTop:100px;dialogLeft:100px;resizable:0;scroll:0;center:1';
showModelessDialog("http://www.daxueit.com/",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.daxueit.com/','','width=900,height=590');
window.opener=null;
window.close();
</script>
«上一页12下一页»


相关评论