html圆圈倒计时,用HTML5实现的圆形时钟倒计时

CSS3圆环倒计时-源码搜藏网

.pie { width:200px; height:200px; background-color:blue; border-radius:100px; position:absolute; }

.pie1 { clip:rect(0px,200px,200px,100px); -o-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); background:-moz-radial-gradient(20% 50% 0deg, #333, #0000ff); background:-webkit-gradient(radial, 100 100, 0, 100 100, 110, from(#000), to(#0000ff)); }

.pie2 { clip:rect(0px,100px,200px,0px); -o-transform:rotate(0deg); -moz-transform:rotate(0deg); -webkit-transform:rotate(0deg); background:-moz-radial-gradient(80% 50% 0deg, #333, #0000ff); background:-webkit-gradient(radial, 100 100, 0, 100 100, 110, from(#000), to(#0000ff)); }

.hold { width:200px; height:200px; position:absolute; z-index:1; }

.hold1 { clip:rect(0px,200px,200px,100px); }

.hold2 { clip:rect(0px,100px,200px,0px); }

.bg { width:200px; height:200px; background-color:red; border-radius:100px; position:absolute; box-shadow:0px 0px 8px #333; background:-moz-radial-gradient(0% 50% 0deg, #900, #ff0000); background:-webkit-gradient(radial, 100 100, 0, 100 100, 110, from(#900), to(#ff0000)); }

.time { width:160px; height:160px; margin:20px 0 0 20px; background-color:#fff; border-radius:100px; position:absolute; z-index:1; box-shadow:0px 0px 8px #333 inset; text-align:center; line-height:160px; font-family:"Book Antiqua", Palatino, serif; font-size:35px; font-weight:bold; text-shadow: 1px 1px 3px #333; }

.time em { background:#fff; position:absolute; top:62px; left:12px; height:18px; width:140px; opacity:0.4; }

i = 0;

j = 0;

count = 0;

MM = 4;

SS = 59;

MS = 9;

totle = (MM+1)*600;

d = 180*(MM+1);

MM = "0" + MM;

function showTime(){

totle = totle - 1;

if(totle==0){

clearInterval(s);

clearInterval(t1);

clearInterval(t2);

$(".pie2").css("-o-transform","rotate(" + d + "deg)");

$(".pie2").css("-moz-transform","rotate(" + d + "deg)");

$(".pie2").css("-webkit-transform","rotate(" + d + "deg)");

}else{

if(totle>0 && MS>0){

MS = MS - 1;

if(MS < 10){MS = "0" + MS};

};

if(MS==0 && SS>0){

MS = 10;

SS = SS - 1;

if(SS < 10){SS = "0" + SS};

};

if(SS==0 && MM>0){

SS = 60;

MM = MM - 1;

if(MM < 10){MM = "0" + MM};

};

};

$(".time span").html(MM + ":" + SS + ":" + MS);

};

s = setInterval("showTime()",100);

function start1(){

i = i + 0.6;

count = count + 1;

if(count==300){

count = 0;

clearInterval(t1);

t2 = setInterval("start2()",100);

};

$(".pie1").css("-o-transform","rotate(" + i + "deg)");

$(".pie1").css("-moz-transform","rotate(" + i + "deg)");

$(".pie1").css("-webkit-transform","rotate(" + i + "deg)");

};

function start2(){

j = j + 0.6;

count = count + 1;

if(count==300){

count = 0;

clearInterval(t2);

t1 = setInterval("start1()",100);

};

$(".pie2").css("-o-transform","rotate(" + j + "deg)");

$(".pie2").css("-moz-transform","rotate(" + j + "deg)");

$(".pie2").css("-webkit-transform","rotate(" + j + "deg)");

};

t1 = setInterval("start1()",100);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值