工作进度进度条js

/**
 * 绘制简单百分比进度条
 * 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>");

 }
}

转载于:https://www.cnblogs.com/butterfly/archive/2009/04/11/1433618.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值