???有答案了发什么<html>
<script type="text/javascript">
function likeThis(event){
if(event.button==1)
alert("Left button");
else if(event.button==2){
alert("u'r deminated.");
closeWin();
}
}
function closeWin(){
var cur=0;
var delay=10; //10s 关闭
window.setInterval(function(){
window.status="还有"+(delay-cur)+"秒关闭";
if((delay-cur)==0){
opener=null;
window.close();
}
cur++;
},1000);
}
</script>
<body onmousedown="likeThis(event)">
</body>
</html>
<script type="text/javascript">
function likeThis(event){
if(event.button==1)
alert("Left button");
else if(event.button==2){
alert("u'r deminated.");
closeWin();
}
}
function closeWin(){
var cur=0;
var delay=10; //10s 关闭
window.setInterval(function(){
window.status="还有"+(delay-cur)+"秒关闭";
if((delay-cur)==0){
opener=null;
window.close();
}
cur++;
},1000);
}
</script>
<body onmousedown="likeThis(event)">
</body>
</html>
setTimeout()函数就可以;
我一直都用setTimeout来做倒计时...
setInterval到是没用过...
又跟hanpoyangtitan老兄多学了一招^_^
setTimeout调用函数本身当函数运行时即发生一次
setInterval调用函数在时间n后执行第一次。