用JS打开windows下的几种窗体格式

来源:互联网 发布:软件行业岗位调查报告 编辑:程序博客网 时间:2024/06/07 04:31
  1. <html>  
  2. <head>  
  3.     <title>打开新窗口</title>      
  4. <SCRIPT>  
  5. //打开新窗口全屏  
  6. function ow(owurl){  
  7.     var tmp=window.open("about:blank","","fullscreen=1")  
  8.     tmp.moveTo(0,0)  
  9.     tmp.resizeTo(screen.width+20,screen.height)  
  10.     tmp.focus()  
  11.     tmp.location=owurl  
  12. }  
  13. function WinOpen() {  
  14.     window.open("http://www.baidu.com","DisplayWindow","toolbar=no,,menubar=no,location=no,scrollbars=no");  
  15. }  
  16. //网页消息对话框  
  17. function openModelessDialog(){  
  18.     var features='status:0;dialogWidth:470px;dialogHeight:270px;resizable:0;scroll:0;center:1';  
  19.     showModelessDialog("http://www.baidu.com",window,features);  
  20. }  
  21.   
  22. //网页对话框,一次只能打开一个  
  23. function openModalDialog(){  
  24.     var features='status:0;dialogWidth:470px;dialogHeight:270px;resizable:0;scroll:0;center:1';  
  25.     showModalDialog("http://www.baidu.com",window,features);  
  26. }  
  27.   
  28. //子窗口打开,关闭父窗口  
  29. function openChild(){  
  30.     window.open('http://www.baidu.com/','','width=790,height=590');  
  31.     window.opener=null;  
  32.     window.close();  
  33. }  
  34. </SCRIPT>  
  35.   
  36. </head>  
  37. <body>  
  38.     <button onclick="javascript:ow('http://www.baidu.com')">打开新窗口全屏</button><br>  
  39.     <button onclick="WinOpen()">正常打开一个弹出窗口</button><br>  
  40.     <button onclick="openModelessDialog()">网页对话框[打开多个]</button><br>  
  41.     <button onclick="openModalDialog()">网页对话框[打开一个]</button><br>  
  42.     <button onclick="openChild()">子窗口打开,关闭父窗口</button><br>  
  43. </body>  
  44. </html> 
0 0
原创粉丝点击