定义进度条,用来表示某个过程的完成程度。
要应用该组件,请为 <progress> 元素添加 .uk-progress 类。
<progress class="uk-progress" value="" max=""></progress><progress id="js-progressbar" class="uk-progress" value="10" max="100"></progress>
<script>
UIkit.util.ready(function () {
var bar = document.getElementById('js-progressbar');
var animate = setInterval(function () {
bar.value += 10;
if (bar.value >= bar.max) {
clearInterval(animate);
}
}, 1000);
});
</script>