61,115
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>信大电磁环境监测平台</title>
<style>
body {
font-size: 12px;
}
#n {
margin: 10px auto;
width: 920px;
border: 1px solid #CCC;
font-size: 14px;
line-height: 30px;
}
#n a {
padding: 0 4px;
color: #333
}
.Bar,.Bars {
position: relative;
width: 200px; /* 宽度 */
border: 1px solid #B1D632;
padding: 1px;
}
.Bar div,.Bars div {
display: block;
position: relative;
background: #00F; /* 进度条背景颜色 */
color: #333333;
height: 20px; /* 高度 */
line-height: 20px; /* 必须和高度一致,文本才能垂直居中 */
}
.Bars div {
background: #090
}
.Bar div span,.Bars div span {
position: absolute;
width: 200px; /* 宽度 */
text-align: center;
font-weight: bold;
}
.cent {
margin: 0 auto;
width: 300px;
overflow: hidden
}
#status>div:not(:nth-of-type(1)){
display: none;
}
#btns{
text-align: center;
}
</style>
</head>
<body>
<p> </p>
<div class="cent">
<p>频率变化进度:</p>
<p>
<div class="Bars">
<div style="width: 0%;">
<span></span>
</div>
</div>
</p>
</div>
<p id="btns">
<button onclick="stop(timer)">stop</button>
<button onclick="start('show();', delay);">start</button>
</p>
<p>
返回下载<a href="http://www.divcss5.com/template/m411.shtml">CSS进度条</a>
</p>
</body>
<body>
<div id="status">
<div>
<img src="http://chuantu.biz/t2/11/1438825741x-954497768.png" />
</div>
<div>
<img src="http://chuantu.biz/t2/11/1438825765x-954497768.png" />
</div>
<div>
<img src="http://chuantu.biz/t2/11/1438825794x-954497768.png" />
</div>
<div>
<img src="http://chuantu.biz/t2/11/1438825813x-954497768.png" />
</div>
<div>
<img src="http://chuantu.biz/t2/11/1438825832x-954497768.png" />
</div>
</div>
</body>
</html>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
var current = 1;
var delay = 1000;
var timer;
timer = start("show();", delay);
function start(cod, delay){
return timer = setInterval(cod, delay);
}
function stop(timer) {
timer = clearInterval(timer);
};
function show(){
var len = $('#status>div').length;
$('#status>div:nth-of-type('+current+')').css('display', 'none');
current = current % len + 1;
$('#status>div:nth-of-type('+current+')').css('display', 'block');
$('.Bars>div>span').html(Math.round(current * 100 / len) + '%');
$('.Bars>div').css('width', Math.round(current * 100 / len) + '%');
}
</script>