脚本说明:
把如下代码加入<body>区域中
<input type=button value=新开窗口延迟打开 onclick=javascript:setTimeout("window.open('http://www.jzzy.com')",10000)>
function delay(gap){ /* gap is in millisecs */
var then,now; then=new Date().getTime();
now=then;
while((now-then)<gap)
{now=new Date().getTime();}
}//
把如下代码加入<body>区域中
<input type=button value=新开窗口延迟打开 onclick=javascript:setTimeout("window.open('http://www.jzzy.com')",10000)>
function delay(gap){ /* gap is in millisecs */
var then,now; then=new Date().getTime();
now=then;
while((now-then)<gap)
{now=new Date().getTime();}
}//
博客介绍了使用JavaScript实现窗口延迟打开的方法。在<body>区域添加代码,通过setTimeout函数设置延迟时间打开指定网页,还给出了一个自定义的延迟函数,利用循环计算时间差来实现延迟。

被折叠的 条评论
为什么被折叠?



