bootstrap添加progressbar及提示

戈正初
2023-12-01
<div class="progress progress-striped active"  style="height: 45%; width: 80%; ">
     <div class="progress-bar progress-bar-success " id="time" role="progressbar" 
     aria-valuenow="20"aria-valuemin="0" aria-valuemax="100" style="width:20%; 
     text-align: center; background-color: #FFCC66">
 <strong id="times" style="font-size: 4rem; line-height: 1.5; color: #cc9900;"></strong>
   </div>
   </div>

上面的代码就是progressbar,下面是给progressbar添加提示内容。

var myDate = new Date();
var progress = Math.round((myDate.getMinutes() + myDate.getHours() * 60) / (24 * 60) * 100)  + "%";
 window.parent.document.getElementById("times").innerHTML = (Math.round((myDate.getMinutes() + myDate.getHours() * 60) / (24 * 60) * 100) + "%");
   $("#time").css('width', progress);

参考文章https://blog.csdn.net/i10630226/article/details/49906781

 类似资料: