1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > CSS3 圆形时钟式网页进度条

CSS3 圆形时钟式网页进度条

时间:2018-07-14 16:32:06

相关推荐

CSS3 圆形时钟式网页进度条

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="/1999/xhtml">

<head>

<title>CSS3时钟式进度条</title>

<meta http-equiv="content-type" content="text/html;charset=gb2312">

<style type="text/css">

#cricle{width:200px;height:200px;position:relative;background:#333;overflow:hidden}

#cricle .left,#cricle .right,#cricle .text{width:200px;height:200px}

#cricle .text{position:absolute;top:0;left:0;z-index:41;color:#fff;font:26px/200px 'arial';text-align:center}

#cricle .mask{z-index:40}

#cricle .mask,#cricle .bg{width:100px;height:200px;background:#333;position:absolute;top:0}

#cricle .bg{background:url(/jscss/demoimg/07/bg_green.png) no-repeat 0 0}

#cricle .mask,#cricle .left .bg{left:0}

#cricle .right{display:none}

#cricle .right .bg{background-position:right top;right:0}

</style>

<script src="/ajaxjs/jquery1.3.2.js"></script>

</head>

<body>

<div id="cricle">

<div class="mask"></div>

<div class="left">

<div class="bg"></div>

</div>

<div class="right">

<div class="bg"></div>

</div>

<div class="text"></div>

</div>

<script type="text/javascript">

var C = function(id){

this.box = $("#"+id);

this.left = this.box.find(".left");

this.right = this.box.find(".right");

this.mask = this.box.find(".mask");

this.text = this.box.find(".text");

this.d = 0;

this.A = null;

this.init();

}

C.prototype = {

init : function(){

var T = this;

this.A = window.setInterval(function(){T.change()},80);

},

change : function(){

var T = this;

if(this.d>180){

if(this.d>360){

window.clearInterval(this.A);

this.A = null;

return;

}

this.right.show();

this.mask.hide();

}

this.text.text(parseInt(this.d/3.6));

this.left.css({

"-webkit-transform":"rotate("+this.d+"deg)",

"-moz-transform":"rotate("+this.d+"deg)"

})

this.d += 6;

}

}

new C("cricle");

</script>

</body>

</html>

原文链接:/jscss/code/3573.shtml

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。