jquery實現(xiàn)百分比記分進(jìn)度條
更新時間:2021年04月29日 11:33:29 作者:HouMengFei_
這篇文章主要為大家詳細(xì)介紹了jquery實現(xiàn)百分比記分進(jìn)度條,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了jquery實現(xiàn)百分比記分進(jìn)度條的具體代碼,供大家參考,具體內(nèi)容如下
1.先看效果

2.代碼如下

jquery.lineProgressbar.js代碼如下
(function($){
'use strict';
$.fn.LineProgressbar = function(options){
var options = $.extend({
percentage : null,
ShowProgressCount: true,
duration: 1000,
// Styling Options
fillBackgroundColor: '#3498db',
backgroundColor: '#EEEEEE',
radius: '0px',
height: '10px',
width: '100%'
},options);
return this.each(function(index, el) {
// Markup
$(el).html('<div class="progressbar"><div class="proggress"></div></div><div class="percentCount"></div>');
var progressFill = $(el).find('.proggress');
var progressBar= $(el).find('.progressbar');
progressFill.css({
backgroundColor : options.fillBackgroundColor,
height : options.height,
borderRadius: options.radius
});
progressBar.css({
width : options.width,
backgroundColor : options.backgroundColor,
borderRadius: options.radius
});
// Progressing
progressFill.animate(
{
width: options.percentage + "%"
},
{
step: function(x) {
if(options.ShowProgressCount){
$(el).find(".percentCount").text("("+Math.round(x) + "分"+")");
}
},
duration: options.duration
}
);
});
}
})(jQuery);
jquery.lineProgressbar.css樣式代碼如下
#progressbar1{
display: flex;
height: 15px;
}
.progressbar {
width: 50%;
margin-top: 5px;
position: relative;
background: #182746 !important;
border-radius: 6px !important;
box-shadow: inset 0px 1px 1px rgba(0,0,0,.1);
}
.proggress{
height: 8px;
width: 10px;
background: linear-gradient(to right, rgb(13, 93, 176), rgb(32, 177, 223)) !important;
border-radius: 6px !important;
}
.percentCount{
white-space: nowrap;
margin-left: 10px;
font-size: 14px;
}
這樣就可以實現(xiàn)記分條,百分比的話只需要將分改成%就OK了。
直接用!?。?br />
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- jquery 簡單的進(jìn)度條實現(xiàn)代碼
- 6款新穎的jQuery和CSS3進(jìn)度條插件推薦
- 分享8款優(yōu)秀的 jQuery 加載動畫和進(jìn)度條插件
- jquery實現(xiàn)的一個簡單進(jìn)度條效果實例
- 基于HTML5 Ajax文件上傳進(jìn)度條如何實現(xiàn)(jquery版本)
- Javascript jquery css 寫的簡單進(jìn)度條控件
- jQuery EasyUI API 中文文檔 - ProgressBar 進(jìn)度條
- jQuery實現(xiàn)文件上傳進(jìn)度條特效
- jQuery監(jiān)聽文件上傳實現(xiàn)進(jìn)度條效果的方法
- 利用jQuery實現(xiàn)漂亮的圓形進(jìn)度條倒計時插件
相關(guān)文章
Jquery Ajax Error 調(diào)試錯誤的技巧
jquery在程序開發(fā)ajax應(yīng)用程序時提高了效率,減少了需要兼容性的問題,當(dāng)我們在ajax項目中,遇到ajax異步獲取數(shù)據(jù)出錯該怎么解決呢,我們可以通過捕捉error事件來獲取出錯的信息,本文給大家介紹jquery ajax error調(diào)試錯誤的技巧,感興趣的朋友一起學(xué)習(xí)吧2015-11-11
jQuery Validate 數(shù)組 全部驗證問題
這篇文章主要介紹了jquery validate 數(shù)組 全部驗證問題及解決辦法,非常不錯,具有參考借鑒價值,需要的朋友參考下吧2017-01-01
動態(tài)設(shè)置form表單的action屬性的值的簡單方法
下面小編就為大家?guī)硪黄獎討B(tài)設(shè)置form表單的action屬性的值的簡單方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-05-05

