var pos = ((pposition-min)/(max-min))*len;
eprogress = e.children(0).children(0);
if(pos>=this.width){
eprogress.style.width = this.width-4;
this.currpos = pos;
}else if(pos<=0){
eprogress.style.width = 0;
this.currpos = pos;
}else{
eprogress.style.width = pos;
this.currpos = pos;
}
return this.currpos;
}catch(e){
alert(e.description);
return -1;
}
}
function xyupdatepersent(ppersent){ /*从当前位置增长或减小ppersent%,ppersent大于零:增长,否则,减小*/
try{
var e = document.all(this.xyprogressid);
e = e.children(0).children(0);
var len = this.width;
var pos = this.currpos;
len = len*ppersent/100;
pos += len;
if(pos>this.width||pos<0){
return -1;
}
e.style.width = pos;
this.currpos = pos;
return this.currpos;
}catch(e){
alert(e.description);
return -1;
}
}
function xyupdatetopersent(ppersent){ /*从当前位置增长或减小到ppersent%*/
try{
var e = document.all(this.xyprogressid);
e = e.children(0).children(0);
var len = this.width;
var pos = len*ppersent/100;
if(pos>this.width||pos<0){
return -1;
}
e.style.width = pos;
this.currpos = pos;
return this.currpos;
}catch(e){
alert(e.description);
return -1;
}
}
function xynewid(){
var d = new date();
var t = "odraw_"+d.gettime().tostring();
return t;
}
</script>
</head>
<body topmargin=0 id="bodyid">
<script>
var xy = new xyprogresslg("kitty");
xy.setprogressleft(200)
xy.setprogresstop(200);
xy.setprogresswidth(200)
xy.setprogressheight(20)
xy.setprogressmax(200)
xy.setprogressmin(50);
</script>
<script language="javascript">
function update(){
xy.updateposition(10)
settimeout("update()",100);
}
</script>
<button onclick="xy.updatetopersent(20)">update</button>
<button onclick="xy.updateposition(10)">updateposition</button>
<button onclick="update()">autoupdate</button>
</body>
</html>