jquery實(shí)現(xiàn)百分比記分進(jìn)度條
本文實(shí)例為大家分享了jquery實(shí)現(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; }
這樣就可以實(shí)現(xiàn)記分條,百分比的話只需要將分改成%就OK了。
直接用!??!
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- jquery 簡(jiǎn)單的進(jìn)度條實(shí)現(xiàn)代碼
- 6款新穎的jQuery和CSS3進(jìn)度條插件推薦
- 分享8款優(yōu)秀的 jQuery 加載動(dòng)畫和進(jìn)度條插件
- jquery實(shí)現(xiàn)的一個(gè)簡(jiǎn)單進(jìn)度條效果實(shí)例
- 基于HTML5 Ajax文件上傳進(jìn)度條如何實(shí)現(xiàn)(jquery版本)
- Javascript jquery css 寫的簡(jiǎn)單進(jìn)度條控件
- jQuery EasyUI API 中文文檔 - ProgressBar 進(jìn)度條
- jQuery實(shí)現(xiàn)文件上傳進(jìn)度條特效
- jQuery監(jiān)聽文件上傳實(shí)現(xiàn)進(jìn)度條效果的方法
- 利用jQuery實(shí)現(xiàn)漂亮的圓形進(jìn)度條倒計(jì)時(shí)插件
相關(guān)文章
jQuery遮罩層實(shí)現(xiàn)方法實(shí)例詳解(附遮罩層插件)
這篇文章主要介紹了jQuery遮罩層實(shí)現(xiàn)方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了jQuery遮罩層樣式及功能實(shí)現(xiàn)技巧,并附帶分析了一個(gè)簡(jiǎn)單jQuery遮罩層插件實(shí)現(xiàn)方法,需要的朋友可以參考下2015-12-12基于jQuery實(shí)現(xiàn)圖片推拉門動(dòng)畫效果的兩種方法
本文給大家分享兩種方法實(shí)現(xiàn)''推拉門''動(dòng)畫效果也可以稱作是手風(fēng)琴效果,具體實(shí)現(xiàn)方法大家通過(guò)本文一起學(xué)習(xí)吧2017-08-08jQuery實(shí)現(xiàn)的簡(jiǎn)單折疊菜單(折疊面板)效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡(jiǎn)單折疊菜單(折疊面板)效果代碼,涉及jQuery中slideToggle與toggleClass方法的靈活使用技巧,需要的朋友可以參考下2015-09-09jquery+css實(shí)現(xiàn)絢麗的橫向二級(jí)下拉菜單-附源碼下載
這篇文章主要介紹了jquery+css實(shí)現(xiàn)絢麗的橫向二級(jí)下拉菜單-附源碼下載,需要的朋友可以參考下2015-08-08jQuery彈出層始終垂直居中相對(duì)于屏幕或當(dāng)前窗口
碰到?jīng)]有固定高或者固定寬或者固定高和寬的時(shí)候,我們就需要用JS去處理,去動(dòng)態(tài)獲取當(dāng)前窗口高或者寬;今天弄了2種情況,一個(gè)是相對(duì)于屏幕窗體,一個(gè)是相對(duì)于當(dāng)前的窗口,看代碼2013-04-04sliderToggle在寫jquery的計(jì)時(shí)器setTimeouter中不生效
sliderToggle在setTimeouter中不生效,還報(bào)錯(cuò)說(shuō)是發(fā)生了意想不到的錯(cuò)誤2014-05-0520個(gè)非常棒的Jquery實(shí)用工具 國(guó)外文章
網(wǎng)站設(shè)計(jì)者往往會(huì)設(shè)計(jì)一些小的工具類(widgets)或者一些可復(fù)用的程序,從而使頁(yè)面更楚楚動(dòng)人,更吸引瀏覽者駐足。這里收集了20個(gè)常用Jquery工具類,這些小的工具可以幫助網(wǎng)站設(shè)計(jì)人員和站長(zhǎng)非常容易地創(chuàng)建漂亮的站點(diǎn)。2010-01-0130個(gè)經(jīng)典的jQuery代碼開發(fā)技巧
這篇文章主要介紹了30個(gè)經(jīng)典的jQuery代碼開發(fā)技巧,包含了常見(jiàn)屬性、方法、元素等的使用技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2014-12-12jquery ajaxfileupload異步上傳插件使用詳解
這篇文章主要為大家詳細(xì)介紹了jquery ajaxfileupload異步上傳插件的使用,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-02-02