网页对话框

来源:百度知道 编辑:UC知道 时间:2024/06/08 04:34:58
关闭网页弹出对话框 ,怎么使对话框5秒后自动关闭
<script language=javascript>
<!--

function closing()
{
alert("欢迎再来");
window.close
}
/-->
</script>

<script>
function window.onbeforeunload(){
with(window.event)if(clientY<0&&clientX>document.body.clientWidth||altKey)closing()
}
</script>

1。跟随页面弹出的窗口在规定时间内自动关闭,而且不作任何提示

代码:<script language="JavaScript">
<!--
url="popup.htm"
window.open(url, 'www_helpor_net', 'width=468,height=60,resizable=1,scrollbars=no,left=100,top=50')
-->
</script>

然后,在相同目录下新建一个popup.htm网页(注意要与上面的url对应!),用于显示在弹出窗口中。在新建文件的源代码中加入如下代码:
<script language="JavaScript">
function closeit() {
setTimeout("self.close()",10000)
}
closeit()
</script>

2。你可能想在你的网页上加上一个弹出窗口,以给来访者提示或问侯、网站的重要通告、网站广告之类的。但人们对弹出窗口要去关闭感到很烦,但用得不好会让人产生厌烦心理。如何才能让弹出窗口发挥作用,而又不影响浏览者浏览页面呢?

如果能让它自己关闭,而且在关闭时无提示那该多好。要实现这种效果其实很简单,代码如下:

1、首先,把下面的代码加入到<head></head>之间。

<script language="JavaScript">
<!--
var gt = unescape('3e');
var popup = null;
var over = "Launch Pop-up Navigator";
popup = window.open('', 'po