JS 倒计时下载

<a class="down" href="/download/610.html" id="down"><b></b>Download Now</a>
     <div><em id="second">5</em>秒后自动下载...</div>

//倒计时
var interval;
function stop(now){
if(parseInt($('#second').text()) <= 1 || now){
$('#down').children(":first").click();
}else{
$('#second').text(parseInt($('#second').text()) - 1);
}	
}
interval = setInterval(stop, 1000);

$('#down').click(function(){
clearInterval(interval);
$('#second').parent().hide();
});

未经允许不得转载:SuperMan's blog » JS 倒计时下载

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址