我有这个代码。
HTML
<div class="progress-bar">
<span class="progress-bar-fill" style="width: 30%"></span>
</div>CSS
.progress-bar {
width: calc(100% - 6px);
height: 5px;
background: #e0e0e0;
padding: 3px;
border-radius: 3px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
}
.progress-bar-fill {
display: block;
height: 5px;
background: #659cef;
border-radius: 3px;
transition: width 250ms ease-in-out;
}它应该显示滑块的进度,以及当前图像将持续多长时间直到下一个图像...
如果图像每5秒更改一次,那么我希望条形图在5秒内填满100%…我对javascript和jQuery一窍不通...
发布于 2017-04-08 14:14:01
您可以让jQuery在一次操作中设置转换声明。
填写5s:
$(".progress-bar-fill").css({"width":"100%","transition":"5s"});
立即清空:
$(".progress-bar-fill").css({"width":"0%","transition":"none"});
https://stackoverflow.com/questions/33096675
复制相似问题