</body> <script> docu " /> 成人黄色免费看,一区二区三区四区高清精品免费观看 ,午夜精品福利电影

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

一個已封裝好的漂亮進度條





復制代碼 代碼如下:
<body>
<input type="button" value="start" onclick="processBar.changeMode();if(processBar.isMoving){this.value='Stop';}else{this.value='Start';}">

</body>
<script>
document.execCommand("BackgroundImageCache",false,true);

function ProcessBar(){
   this.width = 256;
   this.height = 18;
   this.top = 0;
   this.left = 0;
   this.backImg = "process_back.gif";
   this.foreImg = "process.gif";
   this.backDiv = document.createElement("div");
   this.foreDiv = document.createElement("div");
   this.fontDiv = document.createElement("div");

   this.isMoving = false;
   this.nowLength = 0;
   this.moveInterval = 100;
   this.moveRange = 1;
   this.timer;

   ProcessBar.nowObj = this;

   this.init = function(){
        this.foreDiv.style.backgroundImage = "url(" + this.foreImg + ")";
        this.foreDiv.style.backgroundRepeat = "no-repeat";
        this.foreDiv.style.position = "absolute";
        this.foreDiv.style.width = this.nowLength;
        this.foreDiv.style.height = this.height;
        this.foreDiv.style.top = 0;
        this.foreDiv.style.left = 0;

        this.fontDiv.style.background = "transparent";
        this.fontDiv.style.position = "absolute";
        this.fontDiv.style.width = this.width;
        this.fontDiv.style.height = this.height;
        this.fontDiv.style.top = 2;
        this.fontDiv.style.left = 0;
        this.fontDiv.style.textAlign = "center";
        this.fontDiv.style.fontSize = "13px";
        this.fontDiv.appendChild(document.createTextNode(" "));

        this.backDiv.style.backgroundImage = "url(" + this.backImg + ")";
        this.backDiv.style.backgroundRepeat = "no-repeat";
        this.backDiv.style.position = "absolute";
        this.backDiv.style.width = this.width;
        this.backDiv.style.height = this.height;
        this.backDiv.style.top = this.top;
        this.backDiv.style.left = this.left;

        this.backDiv.appendChild(this.foreDiv);
        this.backDiv.appendChild(this.fontDiv);

        document.body.appendChild(this.backDiv);
   }

   this.changeMode = function(){
        this.isMoving = !this.isMoving;

        if(this.isMoving){
            this.timer = window.setInterval(ProcessBar.nowObj.moving, this.moveInterval);
        }else{
            window.clearInterval(this.timer);
        }
   }

   this.moving = function(){
        ProcessBar.nowObj.nowLength += ProcessBar.nowObj.moveRange;
        ProcessBar.nowObj.foreDiv.style.width = ProcessBar.nowObj.nowLength;

        ProcessBar.nowObj.fontDiv.firstChild.data = Math.ceil((ProcessBar.nowObj.nowLength/ProcessBar.nowObj.width )*100) + "%";

        if(ProcessBar.nowObj.nowLength >= ProcessBar.nowObj.width ){
            window.clearInterval(ProcessBar.nowObj.timer);
            ProcessBar.nowObj.fontDiv.firstChild.data = "Complete!";
        }
   }

   
}

var processBar = new ProcessBar();
processBar.backImg = "/upload/2007415102314868.gif"; processBar.foreImg = "/upload/2007415102319734.gif"; processBar.top = 100;
processBar.left = 20;
processBar.init();
</script>



[Ctrl+A 全選 注:如需引入外部Js需刷新才能執行]

JavaScript技術一個已封裝好的漂亮進度條,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 镇雄县| 柳州市| 手游| 沙田区| 呼伦贝尔市| 花莲县| 五莲县| 定西市| 新宁县| 怀安县| 渑池县| 即墨市| 昌江| 萨迦县| 皋兰县| 揭西县| 阿鲁科尔沁旗| 霍城县| 龙陵县| 定西市| 朝阳县| 建阳市| 台南市| 新平| 灵丘县| 高密市| 卢氏县| 长垣县| 潞西市| 道真| 华池县| 栾川县| 丰县| 彩票| 五华县| 遂昌县| 南川市| 阳城县| 图们市| 连山| 二手房|