Javascript教程:弹出式窗口的实现
我们常常在为邮箱弹出的小提示框而感到惊讶,我们也常常为网页弹出的小提示框而感到神气,其实,这都是javascript的功劳,有了javascript的基础,其实你也可以做到;
<SCRIPT LANGUAGE="javascript"> <!-- window.open ('pop1.html') --> </SCRIPT> |
<script language="JavaScript"> <!-- var gt = unescape('%3e'); var popup = null; var over = "Launch Pop-up Navigator"; popup = window.open('', 'popupnav', 'width=200,height=170,resizable=1,scrollbars=auto'if (popup != null) { if (popup.opener == null) { popup.opener = self; } popup.location.href = '说明窗口内容文件.html' } // --> </script> |
<body "closeit()">
7、只让弹出的窗口出现一次(例如在欢迎界面,如果每次刷新就出现不是很烦吗!)
然后再:
8、使用window.showModalDialog
|
<script language="JavaScript"> <!-- function closeit() { setTimeout("self.close()",100000) //单位是毫秒,这里是100秒 </script> |
<FORM> <INPUT TYPE='BUTTON' VALUE='关闭' onClick='window.close()'> </FORM> |
<script LANGUAGE="JavaScript"> <!-- window.open ("pop1.html", "popwindow1", "height=100, width=120, top=0, left=24,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") window.open ("pop2.html", "popwindow2", "height=100, width=200, top=100, left=144,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //--> </script> |
<SCRIPT LANGUAGE="javascript"> <!-- window.open ('pop2.html', 'popwindow', 'height=200, width=320, top=0, left=24, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') --> </SCRIPT> |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |