弹出网页窗口全攻略

[ 2007-11-14 01:07:42 | 作者: Admin ] 字号: | |
如何利用网页弹出各种形式的窗口,但那种多种多样的弹出式窗口是怎么搞出来的,学习一下:

  1.弹启一个全屏窗口
<html>
<body onload="window.open('http://www.pconline.com.cn&#39;,&#39;example01&#39;,&#39;fullscreen&#39;);">;
<b>www.e3i5.com</b>
</body>
</html>

  2.弹启一个被F11化后的窗口
<html>
<body onload="window.open(''http://www.pconline.com.cn&#39;,&#39;example02&#39;,&#39;channelmode&#39;);">;
<b>www.e3i5.com</b>
</body>
</html>

  3.弹启一个带有收藏链接工具栏的窗口
<html>
<body onload="window.open('http://www.pconline.com.cn&#39;,&#39;example03&#39;,&#39;width=400,height=300,directories&#39;);">
<b>www.e3i5.com</b>
</body>
</html>

  4.网页对话框
<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModalDialog('http://www.pconline.com.cn&#39;,&#39;example04&#39;,&#39;dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>www.e3i5.com</b>
</body>
</html>

<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModelessDialog('http://www.pconline.com.cn&#39;,&#39;example05&#39;,&#39;dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>http://www.pconline.com.cn</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"。
help: {yes | no | 1 | 0 } 指定对话框窗口中是否显示上下文敏感的帮助图标。默认值是"yes"。   
resizable: {yes | no | 1 | 0 } 指定是否对话框窗口大小可变。默认值是"no"。
status: {yes | no | 1 | 0 } 指定对话框窗口是否显示状态栏。对于非模式对话框窗口,默认值是"yes";对于模式对话框窗口,默认值是 "no"。
Share
评论Feed 评论Feed: http://www.85815.com/feed.asp?q=comment&id=83
UTF-8 Encoding 引用链接: http://www.85815.com/trackback.asp?id=83&key=
这篇日志没有评论.
发表
表情图标
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
UBB代码
转换链接
表情图标
悄悄话
用户名:   密码:   注册?
验证码 * 请输入验证码