网摘来自:http://hi.csdn.net/houhy/profile
如何利用网页弹出各种形式的窗口,我想大家大多都是知道些的,但那种多种多样的弹出式窗口是怎么搞出来的,我们今天就来学习一下:
1.弹启一个全屏窗口
<html>
<body onload="window.open('http://www.kunde58.com','example01','fullscreen');">;
<b>www.kunde58.com</b>
</body>
</html>
2.弹启一个被F11化后的窗口
<html>
<body onload="window.open(''http://www.kunde58.com','example02','channelmode');">;
<b>www.kunde58.com</b>
</body>
</html>
3.弹启一个带有收藏链接工具栏的窗口
<html>
<body onload="window.open('www.wangye8.com','example03','width=400,height=300,directories');">
<b>www.wangye8.com</b>
</body>
</html>
4.网页对话框
<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModalDialog('http://www.kunde58.com,'example04','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>www.wangye8.com</b>
</body>
</html>
<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModelessDialog('http://www.kunde58.com,'example05','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>http://www.wangye8.com</b>
</body>
</html>
showModalDialog()或是showModelessDialog() 来调用网页对话框,至于showModalDialog()与showModelessDialog()的区别,在于showModalDialog() 打开的窗口(简称模式窗口),置在父窗口上,必须关闭才能访问父窗口(建议尽量少用,以免招人反感);showModelessDialog()
dialogHeight: iHeight 设置对话框窗口的高度。
dialogWidth: iWidth 设置对话框窗口的宽度。
dialogLeft: iXPos 设置对话框窗口相对于桌面左上角的left位置。
dialogTop: iYPos 设置对话框窗口相对于桌面左上角的top位置。
center: {yes | no | 1 | 0 } 指定是否将对话框在桌面上居中,默认值是“yes”。