国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

用htc實現(xiàn)進(jìn)度條控件

2020-01-25 18:09:06
字體:
供稿:網(wǎng)友
代碼如下:

<PUBLIC:COMPONENT> 
<PUBLIC:METHOD   NAME ="Init" INTERNALNAME ="fnCreateProgressBar" /> 
<PUBLIC:METHOD   NAME ="showProgress" INTERNALNAME ="showProgress" /> 
<PUBLIC:PROPERTY NAME="Container"/> 
<PUBLIC:PROPERTY NAME="Speed"/> 

<SCRIPT LANGUAGE=javascript> 
     var startTime = null ;     
     function fnCreateProgressBar(){  
         now  = new Date(); 
        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;     
    } 

   function pause(numberMillis) { 
        var dialogScript =  
           'window.setTimeout(' + 
           ' function () { window.close(); }, ' + numberMillis + ');'; 
        var result =  
         window.showModalDialog( 
           'javascript:document.writeln(' + 
            '"<script>' + dialogScript + '<' + '/script>")'); 
   } 

    function showProgress(StatesDesc){ 
         now  = new Date(); 
         currTime = now.getTime(); 
         now = null 
         if(StatesDesc!=null) window.status = StatesDesc+"當(dāng)前耗時:"+(currTime - startTime)+"毫秒!"; 
        element.bar.style.width = (currTime - startTime) / element.Speed; 
        pause(1) 
    } 
</script> 
</PUBLIC:COMPONENT>

應(yīng)用例子:
復(fù)制代碼代碼如下:

<html> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>進(jìn)度條測試</title> 
<link rel="stylesheet" type="text/css" href="ProgressBar.css"> 
<script> 
function Demo(){ 
    PrgBar.Container = document.all.layer1 
    PrgBar.Init(); 
    for(var i=0;i<500;i++){ 
        if(i%5==0) PrgBar.showProgress("操作進(jìn)行中......") 
    } 
    PrgBar.showProgress("操作完成!") 

</script> 
</head> 

<body> 
<div style="position: absolute; width: 612px; height: 19px; z-index: 1; left: 10px; top: 72px; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" id="layer1"></div> 
<p><input type="button" value="測試" name="B3" onclick="Demo()"></p> 
<Progressbar id="PrgBar" class="ProgressBar" Speed="10"/> 
</body> 

</html>

樣式文件:ProgressBar.css
復(fù)制代碼代碼如下:

.ProgressBar 

    BEHAVIOR: url("ProgressBar.htc") 

.progress{ 
    position: relative;  
    width: 0px;  
    height: 20px;  
    z-index: 1;  
    background-color: #006699; 
    filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#006699,endcolorstr=#E3EFFF,gradientType=0); 
    border: 1px ridge #C0C0C0; 
}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 高淳县| 沂水县| 得荣县| 松江区| 神池县| 洪洞县| 正宁县| 江城| 门源| 宜兰市| 集贤县| 德兴市| 衡山县| 许昌市| 上高县| 左云县| 惠水县| 汉川市| 北安市| 洪雅县| 五台县| 浑源县| 孝义市| 张家港市| 高邮市| 左权县| 永城市| 江西省| 竹山县| 汉寿县| 荆州市| 和平县| 东阿县| 明溪县| 沁源县| 永川市| 化隆| 泽库县| 高雄县| 临潭县| 清原|