ajax bootstrap 进度条,bootstrap进度条美化

.progress {

height: 20px;

background-color: #f5f5f5;

-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);

box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);

overflow: visible;

border-radius: 20px;

margin: 80px 20px;

}

.progress .progress-bar {

position: relative;

float: left;

width: 0;

height: 100%;

font-size: 12px;

line-height: 20px;

color: #fff;

text-align: center;

-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);

box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);

-webkit-transition: width .6s ease;

-o-transition: width .6s ease;

transition: width .6s ease;

border-radius: 20px;

background-color: #001ff8;

}

.progress .progress-value {

box-sizing: border-box;

background-clip: content-box;

display: block;

height: 42px;

line-height: 38px;

width: 42px;

text-align: center;

border-radius: 50%;

font-size: 13px;

color: #fff;

padding: 2px;

background-color: #214eff;

border: 1px solid #214eff;

position: absolute;

top: -60px;

right: -15px;

}

.progress .progress-value:after {

content: "";

border-top: 10px solid #214eff;

border-left: 8px solid transparent;

border-right: 8px solid transparent;

position: absolute;

bottom: -12px;

left: 12px;

}

/*动画效果*/

@-webkit-keyframes progress-bar-stripes {

from {

background-position: 35px 0;

}

to {

background-position: 0 0;

}

}

@keyframes progress-bar-stripes {

from {

background-position: 35px 0;

}

to {

background-position: 0 0;

}

}

/*背景效果*/

.progress-bar-striped, .progress-striped .progress-bar {

background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);

background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);

background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);

-webkit-background-size: 35px 35px;

background-size: 35px 35px;

}

.progress-bar.active, .progress.active .progress-bar {

-webkit-animation: progress-bar-stripes 2s linear infinite;

-o-animation: progress-bar-stripes 2s linear infinite;

animation: progress-bar-stripes 2s linear infinite;

animation-duration: 2s;

animation-timing-function: linear;

animation-delay: 0s;

animation-iteration-count: infinite;

animation-direction: normal;

animation-fill-mode: none;

animation-play-state: running;

animation-name: progress-bar-stripes;

}

var a = 0,

timer = setInterval(function () {

a++ //10-11秒 a+=10=>1-2秒

$(".progress-value").html(a + "%");

$(".progress-bar").width(a + "%");

if (a == 80) {

clearInterval(timer);//清除定时器

$(".progress-bar").removeClass("active");

location.href = "#";//跳转链接

}

}, 100);

0%

效果:

025300b9f18f

image.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值