【发布时间】:2017-04-01 20:48:25
【问题描述】:
我想在 div 中显示基于 7 分钟倒计时的进度条:<div id = "quiz-time-left"> 0:06:24 </ div>
如果页面重新加载,我需要不要重置进度条。是否可以使用 CSS 和脚本来表示计时器显示的内容?
我用这个css进度条:
#quiz-time-left {
width: 0;
height: 100%;
-webkit-animation: progreso 420s linear;
animation: progreso 420s linear;
color: #eb7260;
background: #eb7260;
}
#page-mod-quiz-summary #quiz-timer {
text-align: center;
display: none;
position: absolute;
left: -50px;
top: -50px;
}
#quiz-timer {
border: 2px solid #eb7260;
text-indent: -9999px;
display:block;
font-size: 0px;
height: 35px;
}
@-webkit-keyframes progreso {
0% {
width: 100%;;
}
100% {
width: 0;
}
}
@keyframes progreso {
0% {
width: 100%;
}
100% {
width: 0;
}
}
html
<div id="quiz-timer" role="timer" aria-atomic="true" aria-relevant="text" style="display: block;">Time left: <div id="quiz-time-left">0:06:41</div></div>
谢谢。最好的问候。
【问题讨论】:
标签: javascript css