JS實(shí)現(xiàn)進(jìn)度條動(dòng)態(tài)加載特效
本文實(shí)例為大家分享了JS實(shí)現(xiàn)進(jìn)度條動(dòng)態(tài)加載的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>進(jìn)度條</title> <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script> <style type="text/css"> .container{ width: 480px; margin: 50px; } .progressBar { display: inline-block; width: 81%; height: 22px; background-color: rgba(0,0,0,0.4); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; margin-right: 3%; } #progressFill { width: 0%; height: 22px; position: relative; background-color: #40A4C2; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; background-size: 3em 3em; background-image: linear-gradient(-45deg, transparent 0em, transparent 0.8em, #57D1F7 0.9em, #57D1F7 2.1em, transparent 2.1em, transparent 2.9em, #57D1F7 3.1em); -webkit-animation: warning-animation 750ms infinite linear; -moz-animation: warning-animation 750ms infinite linear; animation: warning-animation 750ms infinite linear; } #progressFill:before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; background-image: linear-gradient(to bottom, #40A4C2, rgbA(37, 117, 188, 0.8) 15%, transparent 60%, #40A4C2); } @-moz-keyframes warning-animation { 0% { background-position: 0 0; } 100% { background-position: 3em 0; } } @-webkit-keyframes warning-animation { 0% { background-position: 0 0; } 100% { background-position: 3em 0; } } @-ms-keyframes warning-animation { 0% { background-position: 0 0; } 100% { background-position: 3em 0; } } @-o-keyframes warning-animation { 0% { background-position: 0 0; } 100% { background-position: 3em 0; } } @keyframes warning-animation { 0% { background-position: 0 0; } 100% { background-position: 3em 0; } } .progressText, #percentage { display: inline-block; margin-top: -11px; vertical-align: middle; } </style> </head> <body> <button id = "begin">點(diǎn)擊開始</button> <div class="container"> <span class = "progressBar"> <div id = "progressFill"></div> </span> <span class = "progressText"> 進(jìn)度 </span> <span id = "percentage">0%</span> </div> </body> <script> $("#begin").on("click",function(){ $("#progressFill").animate({ width: "100%" }, 10*1000); var count = 0; var timer = setInterval(function(){ count++; var percentageValue = count + '%' $("#percentage").html(percentageValue); if(count >= 100) clearInterval(timer); },99) }) </script> </html>
進(jìn)度條動(dòng)態(tài)加載效果圖如下
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- JavaScript canvas繪制圓形加載進(jìn)度條
- 詳解JavaScript+Canvas繪制環(huán)形進(jìn)度條
- JavaScript實(shí)現(xiàn)可動(dòng)的canvas環(huán)形進(jìn)度條
- js+HTML5 canvas 實(shí)現(xiàn)簡單的加載條(進(jìn)度條)功能示例
- JavaScript實(shí)現(xiàn)簡單動(dòng)態(tài)進(jìn)度條效果
- 基于 D3.js 繪制動(dòng)態(tài)進(jìn)度條的實(shí)例詳解
- php+javascript實(shí)現(xiàn)的動(dòng)態(tài)顯示服務(wù)器運(yùn)行程序進(jìn)度條功能示例
- JavaScript實(shí)現(xiàn)審核流程狀態(tài)的動(dòng)態(tài)顯示進(jìn)度條
- JavaScript?canvas繪制動(dòng)態(tài)圓環(huán)進(jìn)度條
相關(guān)文章
javascript自啟動(dòng)函數(shù)的問題探討
自啟動(dòng)函數(shù)想必大家并不陌生吧,在本文將為大家詳細(xì)探討下,感興趣的朋友可不要錯(cuò)過2013-10-10動(dòng)態(tài)加載js、css的簡單實(shí)現(xiàn)代碼
下面小編就為大家?guī)硪黄獎(jiǎng)討B(tài)加載js、css的簡單實(shí)現(xiàn)代碼。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-05-05深入解析ECMAScript?2023?中的新數(shù)組方法
ECMAScript?是一種標(biāo)準(zhǔn)化的腳本語言,它是?JavaScript?的規(guī)范。ECMAScript?2023?是?JavaScript?編程語言的更新,旨在帶來改進(jìn)并使?JavaScript?程序可預(yù)測和可維護(hù),這篇文章主要介紹了探索?ECMAScript?2023?中的新數(shù)組方法,需要的朋友可以參考下2023-12-12Cordova(ionic)項(xiàng)目實(shí)現(xiàn)雙擊返回鍵退出應(yīng)用
這篇文章主要為大家詳細(xì)介紹了Cordova項(xiàng)目實(shí)現(xiàn)雙擊返回鍵退出應(yīng)用,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-09-09javascript實(shí)現(xiàn)網(wǎng)頁中涉及的簡易運(yùn)動(dòng)(改變寬高、透明度、位置)
這篇文章主要介紹了javascript實(shí)現(xiàn)網(wǎng)頁中涉及的簡易運(yùn)動(dòng),比如改變寬高、透明度、位置等,感興趣的小伙伴們可以參考一下2015-11-11JavaScript實(shí)現(xiàn)簡單精致的圖片左右無縫滾動(dòng)效果
這篇文章主要介紹了JavaScript實(shí)現(xiàn)簡單精致的圖片左右無縫滾動(dòng)效果,涉及javascript結(jié)合時(shí)間函數(shù)動(dòng)態(tài)操作頁面元素屬性的相關(guān)技巧,需要的朋友可以參考下2017-03-03js操縱跨frame的聯(lián)動(dòng)select下拉選項(xiàng)實(shí)例介紹
運(yùn)用HTML、CSS以及Javascript相關(guān)知識(shí),編寫多窗口多菜單的內(nèi)容聯(lián)動(dòng),具體思路及代碼如下,感興趣的朋友可以參考下哈,希望大家有所幫助2013-05-05鼠標(biāo)懸浮停留三秒后自動(dòng)顯示大圖js代碼
這篇文章主要介紹了鼠標(biāo)懸浮停留三秒后顯示大圖,在網(wǎng)頁中還是比較實(shí)用的,下面是示例代碼2014-09-09小程序使用watch監(jiān)聽數(shù)據(jù)變化的方法詳解
這篇文章主要介紹了小程序使用watch監(jiān)聽數(shù)據(jù)變化的方法詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-09-09