/**
 * 绘制简单百分比进度条
 * barId 进度条span的ID
 * fPercent 完成的百分数
 * strCaption 标题
 * iHeight 高度
 * iUnit 最小单位
 * bgcolor 背景颜色
 * border 边框样式
 * cursor 光标样式
 */
function SimplePercent(barId, fPercent, strCaption, iHeight, iUnit, bgcolor, border, cursor) {
 var pBar = document.all(barId);
 if (pBar)
 {
  pBar.title = strCaption + fPercent + "%";
  pBar.innerHTML = "";
  if (bgcolor){
   pBar.style.backgroundColor = bgcolor;
  }
  if (border == null){
   border = "1px solid #000000";
  }
  pBar.style.border = border;
  if (cursor == null){
   cursor = "default";
  }
  pBar.style.cursor = cursor;

  if (iHeight == null || iHeight < 1){
   iHeight = 1;
  }
  pBar.style.height = iHeight + "px";
  if (iUnit == null || iUnit < 1){
   iUnit = 1;
  }
  pBar.style.width = (iUnit * 100) + "px";
 
  pBar.insertAdjacentHTML("BeforeEnd", "<span style='width:"+(iUnit*fPercent)+"px;height:"+iHeight+"px;background-color:#0000FF;'></span>");

 }
}

相关文章:

  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
猜你喜欢
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-11-18
  • 2021-09-28
相关资源
相似解决方案