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)容,希望對(duì)大家的學(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(js) join函數(shù)使用方法介紹
javascript(js) join函數(shù)使用方法介紹...2007-11-11
Bootstrap項(xiàng)目實(shí)戰(zhàn)之子欄目資訊內(nèi)容
Bootstrap項(xiàng)目實(shí)戰(zhàn)之資訊內(nèi)容,本文主要學(xué)習(xí)制作一下子欄目資訊內(nèi)容,感興趣的小伙伴們可以參考一下2016-04-04
Electron 隱藏頂部菜單功能實(shí)現(xiàn)
本文介紹了如何在Electron應(yīng)用中隱藏頂部菜單,具體方法是在main.js文件中添加一行代碼,這是一個(gè)簡單有效的技巧,適用于需要簡化界面的Electron應(yīng)用2024-09-09
JavaScript實(shí)現(xiàn)多層顏色選項(xiàng)卡嵌套
這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)多層顏色選項(xiàng)卡嵌套,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-09-09
深入理解Javascript中的valueOf與toString
javascript中所有數(shù)據(jù)類型都擁有valueOf和toString這兩個(gè)方法,null除外。它們倆解決javascript值運(yùn)算與顯示的問題,本文將詳細(xì)介紹,有需要的朋友可以參考下2017-01-01
微信公眾號(hào)H5之微信分享常見錯(cuò)誤和問題(小結(jié))
這篇文章主要介紹了微信公眾號(hào)H5之微信分享常見錯(cuò)誤和問題(小結(jié)),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-11-11
超詳細(xì)小程序定位地圖模塊全系列開發(fā)教學(xué)
這篇文章主要介紹了超詳細(xì)小程序定位地圖模塊全系列開發(fā)教學(xué),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11
圖片img的src不變讓瀏覽器重新加載實(shí)現(xiàn)方法
圖片img的src不變,想讓瀏覽器重新加載怎么辦,在圖片地址src不變的情況下讓瀏覽器重新加載圖片,實(shí)際上在src不變時(shí),瀏覽器直接就去讀取緩存2013-03-03
JavaScript判斷對(duì)象是否為空對(duì)象的幾種常見方法
經(jīng)典面試題,研發(fā)時(shí)也經(jīng)常遇見的一個(gè)問題,如何判斷一個(gè)對(duì)象是空對(duì)象,這篇文章主要給大家介紹了關(guān)于JavaScript判斷對(duì)象是否為空對(duì)象的幾種常見方法,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-06-06

