代码如下:
<PUBLIC:COMPONENT>
<PUBLIC:METHODNAME="Init"INTERNALNAME="fnCreateProgressBar"/>
<PUBLIC:METHODNAME="showProgress"INTERNALNAME="showProgress"/>
<PUBLIC:PROPERTYNAME="Container"/>
<PUBLIC:PROPERTYNAME="Speed"/>
<SCRIPTLANGUAGE=javascript>
varstartTime=null;
functionfnCreateProgressBar(){
now=newDate();
startTime=now.getTime();
now=null
oContainer=element.Container
oContainer.innerHTML="";
oDiv=window.document.createElement("DIV")
oDiv.className="progress"
oContainer.appendChild(oDiv)
oDiv.style.display="";
element.bar=oDiv;
}
functionpause(numberMillis){
vardialogScript=
'window.setTimeout('+
'function(){window.close();},'+numberMillis+');';
varresult=
window.showModalDialog(
'javascript:document.writeln('+
'"<script>'+dialogScript+'<'+'/script>")');
}
functionshowProgress(StatesDesc){
now=newDate();
currTime=now.getTime();
now=null
if(StatesDesc!=null)window.status=StatesDesc+"当前耗时:"+(currTime-startTime)+"毫秒!";
element.bar.style.width=(currTime-startTime)/element.Speed;