进度条 bootstrap
2016-12-19 10:34
375 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 实例 - 进度条</title>
<link rel="stylesheet" href="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body,html,.box{
width:100%;
height:100%;
}
.box{
position: relative;
}
.progress-container{
display: none;
z-index: 100;
position: absolute;
top:50%;
left:20%;
}
</style>
</head>
<body>
<div class="box">
<div class="container progress-container">
<div class="progress progress-striped">
<div class="progress-bar progress-bar-primary" id="processbar" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width:0%">
<span id="aa">80% 完成</span>
</div>
</div>
</div>
<button class="click-button">click</button>
</div>
<script type="text/javascript">
var flag = true;
$(".click-button").on("click",function(){
$(".progress-container").toggle();
// if(flag){
// $(".progress-container").css("disp
4000
lay","block");
// flag = false;
// }else{
// flag = true;
// $(".progress-container").css("display","none");
// }
})
function progress(){
var total = 10000;
var breaker = 100;
var turn = 100 / (total / breaker);
var progress = 0;
var timer = setInterval(function() {
progress = progress + turn;
$("#aa").html(progress + "% 完成");
$("#processbar").attr("style", "width:" + progress + "%");
if(progress >= 100) {
clearInterval(timer);
}
}, breaker);
}
progress();
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 实例 - 进度条</title>
<link rel="stylesheet" href="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body,html,.box{
width:100%;
height:100%;
}
.box{
position: relative;
}
.progress-container{
display: none;
z-index: 100;
position: absolute;
top:50%;
left:20%;
}
</style>
</head>
<body>
<div class="box">
<div class="container progress-container">
<div class="progress progress-striped">
<div class="progress-bar progress-bar-primary" id="processbar" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width:0%">
<span id="aa">80% 完成</span>
</div>
</div>
</div>
<button class="click-button">click</button>
</div>
<script type="text/javascript">
var flag = true;
$(".click-button").on("click",function(){
$(".progress-container").toggle();
// if(flag){
// $(".progress-container").css("disp
4000
lay","block");
// flag = false;
// }else{
// flag = true;
// $(".progress-container").css("display","none");
// }
})
function progress(){
var total = 10000;
var breaker = 100;
var turn = 100 / (total / breaker);
var progress = 0;
var timer = setInterval(function() {
progress = progress + turn;
$("#aa").html(progress + "% 完成");
$("#processbar").attr("style", "width:" + progress + "%");
if(progress >= 100) {
clearInterval(timer);
}
}, breaker);
}
progress();
</script>
</body>
</html>
相关文章推荐
- bootstrap学习23---进度条
- bootstrap与jQuery结合的动态进度条
- bootstrap多种样式进度条展示
- Bootstrap进度条使用方法
- Bootstrap进度条
- bootstrap-进度条--基本样式
- bootstrap3的 progress 进度条
- Bootstrap 各种进度条详解
- Bootstrap 学习之 (十四) ------警告框与进度条
- bootstrap-进度条--彩色进度条
- Bootstrap 进度条
- Bootstrap 组件-进度条
- 基于Bootstrap的多图片(文件也可以)上传、预览、删除、缩放、进度...显示
- Bootstrap响应式前端框架笔记十三——警告框与进度条
- Bootstrap 进度条
- bootstrap进度条
- css3实现进度条-----------------(测试的时候需引入bootstrap)
- Bootstrap 进度条
- bootstrap-进度条--条纹进度条
- 详解Bootstrap进度条组件