代码如下:
<สาธารณะ: ส่วนประกอบ>
<สาธารณะ: methodName = "init" internalName = "fnCreateProgressBar"/>>>>> >>
<สาธารณะ: methodName = "ShowProgress" InternalName = "ShowProgress"/>>>>
<สาธารณะ: propertyName = "container"/> >>
<สาธารณะ: PropertyName = "ความเร็ว"/>
<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;
-
functionpause (numbermillis) {
vardialogscript =
'window.settimeout ('+
'function () {window.close ();},'+numbermillis+');';
Varresult =
window.showmodaldialog (
'JavaScript: document.writeln ('+
'"<script>'+dialogscript+'<'+'/script>")');
-
FunctionShowProgress (statedesc) {
ตอนนี้ = newDate ();
currtime = now.getTime ();
ตอนนี้ = null
if (statedesc! = null) window.status = statedesc+"当前耗时:"+(starttime-starttime)+"毫秒!";
element.bar.style.width = (currtime-starttime) /element.speed;