js window.open()参数与简单实例应用
window.open()方法中,窗口控制参数的详细定义:
alwayslowered innerwidth screeny
alwaysraised left scrollbars
channelmode location status
dependent menubar titlebar
directories outerwidth toolbar
fullscreen outerheight top
height menubar width
hotkeys resizable z-lock
innerheight screenx
//注册窗口
function openreg()
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("w.asp教程?act=reg®goto=","regwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=380,height=300,left="+x+",top="+y);
}//登录窗口
function logins()
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("w.asp?act=logins","regwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=300,height=280,left="+x+",top="+y);
}//会员信息
function memberinfo(id)
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("w.asp?act=member&username="+id,"memberwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=380,height=280,left="+x+",top="+y);
}//发表窗口
function post()
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("post.asp?act=post","regwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=616,height=250,left="+x+",top="+y);
}//编辑
function edit(id)
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("post.asp?act=edit&id="+id,"memberwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=616,height=250,left="+x+",top="+y);
}//删除
function del(id)
{
var x,y;
x=(screen.width-640)/3;
y=(screen.height-480)/3;
window.open("post.asp?act=del&id="+id,"regwindow","toolbar=no,resizable=no,directories=no,status=yes,scrollbars=auto,menubar=no,width=616,height=250,left="+x+",top="+y);
}
<script language="网页特效"> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</script> js脚本结束