代码如下:
<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(stathesdesc){
now = newdate();
Currime = now.getTime();
now = null
if(statesdesc!= null)window.status = statesdesc+"当前耗时:"+(currime-starttime)+"毫秒!";
element.bar.style.width =(currime-starttime)/element.speed;