代码如下:
<公共:组件>
<public:methodName =“ innit” internalName =“ fncreateprogressbar”/>
<public:methodName =“ showprogress” internalName =“ showprogress”/>
<public:propertyName =“容器”/>
<public:propertyName =“ speed”/>
<ScriptLanguage = JavaScript>
varstarttime = null;
functionfnCreateProgressbar(){
现在= newdate();
starttime = now.getTime();
现在= null
ocontainer = element.Container
ocontainer.innerhtml =“”;
odiv = window.document.createelement(“ div”)
odiv.classname =“进度”
ocontainer.appendchild(ODIV)
odiv.style.display =“”;
element.bar = odiv;
}
功能ppause(numbermillis){
vardialogscript =
'window.setTimeout('+
'function(){window.close();},'+numberMillis+');';
Varresult =
window.showmodalialog(
'javaScript:document.writeln('+
'“ <script>'+dialogscript+'<'+'/script>“)');
}
functionshowprogress(statesdesc){
现在= newdate();
currtime = now.getTime();
现在= null
if(statesdesc!= null)window.status = statesdesc+“当前耗时:”+(currtime-starttime)+“毫秒!”;
element.bar.style.width =(currtime-starttime)/element.speed;