html 倒计时关闭对话框,jquery倒计时广告特效代码 可关闭的js倒计时

很多网站播放视频时最开始的倒计时广告,广告时间结束才能看到视频内容,一个JS小贴片广告代码,右上角带关闭按钮,左上角显示倒计时剩余时间,运行jquery代码综合实现,CSS和HTML共同结合的网页特效,兼容各主流浏览器,本效果是从门户网站上整理而来。

例子:

复制代码 代码示例:

js贴片倒计时代码_www.jbxue.com

*{padding:0;margin:0; font-size:12px;}

ol,ul,li{list-style:none}

img{border:none}

.box{ width:564px; height:361px; margin:20px auto; position:relative; display:none;}

.ad_time{ width:554px; height:351px; background:#000; filter:alpha(opacity=50);-moz-opacity:0.5;opacity: 0.5; padding:5px; position:absolute; top:0; left:0;

color:#fff;}

.ad_time span{ font-weight:bold; color:#cc0; padding:0 5px;}

.close{ width:49px; height:20px; background:url(/jscss/demoimg/201308/close.png) no-repeat; position:absolute; top:0; right:0; cursor:pointer;}

.btn{ width:100px; height:30px; background:#eee; border:1px solid #ddd; font:normal 12px/30px '寰?蒋闆呴粦'; text-align:center; margin:20px auto; cursor:pointer;}

function lxfEndtime(){

$t=$('#t').html();

if($t!=0){

$('#t').html($t-1);

$i=setTimeout("lxfEndtime()",1000);

}else{

$('.box').hide();

$('.btn').show();

$('#t').html(6);

$('.ad_time').css({'width':'554px','height':'351px'});

clearTimeout($i);

}

};

$(document).ready(function(){

$('.btn').live('click',function(){

$('.box').show();

$(this).hide();

$('.ad_time').animate({width:110,height:18},'slow');

lxfEndtime();

})

$('.close').click(function(){

$('.box').hide();

$('.btn').show();

$('#t').html(6);

$('.ad_time').css({'width':'554px','height':'351px'});

clearTimeout($i);

})

});

ad.jpg
时间还剩 50
点击显示效果
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值