如何利用網(wǎng)頁(yè)彈出各種形式的窗口,我想大家大多都是知道些的,但那種多種多樣的彈出式窗口是怎么搞出來(lái)的,我們今天就來(lái)學(xué)習一下:
1.彈啟一個(gè)全屏窗口
- <html>
- <body onload="window.open('http://www.pconline.com.cn','example01','fullscreen');">;
- <b>www.e3i5.com</b>
- </body>
- </html>
<html><body onload="window.open('http://www.pconline.com.cn','example01','fullscreen');">;<b>www.e3i5.com</b></body></html> 2.彈啟一個(gè)被F11化后的窗口
- <html>
- <body onload="window.open(''http://www.pconline.com.cn','example02','channelmode');">;
- <b>www.e3i5.com</b>
- </body>
- </html>
<html><body onload="window.open(''http://www.pconline.com.cn','example02','channelmode');">;<b>www.e3i5.com</b></body></html> 3.彈啟一個(gè)帶有收藏鏈接工具欄的窗口
- <html>
- <body onload="window.open('http://www.pconline.com.cn','example03','width=400,height=300,directories');">
- <b>www.e3i5.com</b>
- </body>
- </html>
<html><body onload="window.open('http://www.pconline.com.cn','example03','width=400,height=300,directories');"><b>www.e3i5.com</b></body></html> 4.網(wǎng)頁(yè)對話(huà)框
- <html>
- <SCRIPT LANGUAGE="javascript">
- <!--
- showModalDialog('http://www.pconline.com.cn','example04','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"><!--showModalDialog('http://www.pconline.com.cn','example04','dialogWidth:400px;dialogHeight:300px;dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')//--></SCRIPT><b>www.e3i5.com</b></body></html> showModalDialog()或是showModelessDialog() 來(lái)調用網(wǎng)頁(yè)對話(huà)框,至于showModalDialog()與showModelessDialog()的區別,在于showModalDialog() 打開(kāi)的窗口(簡(jiǎn)稱(chēng)模式窗口),置在父窗口上,必須關(guān)閉才能訪(fǎng)問(wèn)父窗口(建議盡量少用,以免招人反感);showModelessDialog()(簡(jiǎn)稱(chēng)無(wú)模式窗口),打開(kāi)后不必關(guān)閉也可訪(fǎng)問(wèn)父窗口打開(kāi)的窗口。
dialogHeight: iHeight 設置對話(huà)框窗口的高度。
dialogWidth: iWidth 設置對話(huà)框窗口的寬度。
dialogLeft: iXPos 設置對話(huà)框窗口相對于桌面左上角的left位置。
dialogTop: iYPos 設置對話(huà)框窗口相對于桌面左上角的top位置。
center: {yes | no | 1 | 0 } 指定是否將對話(huà)框在桌面上居中,默認值是“yes”。
help: {yes | no | 1 | 0 } 指定對話(huà)框窗口中是否顯示上下文敏感的幫助圖標。默認值是“yes”。
resizable: {yes | no | 1 | 0 } 指定是否對話(huà)框窗口大小可變。默認值是“no”。
status: {yes | no | 1 | 0 } 指定對話(huà)框窗口是否顯示狀態(tài)欄。對于非模式對話(huà)框窗口,默認值是“yes”;對于模式對話(huà)框窗口,默認值是 “no”。