/** * jQuery Line Progressbar * Author: Sharifur Rahman * Author URI : https:devrobin.com * Version: 1.0.0 */ ; (function($) { 'use strict'; $.fn.rProgressbar = function(options) { options = $.extend({ percentage: null, ShowProgressCount: true, duration: 1000, fillBackgroundColor: '#ed1c24', backgroundColor: '#EEEEEE', borderRadius: '0px', height: '10px', width: '100%' }, options); $.options = options; return this.each(function(index, el) { $(el).html('
'); var lineProgressBarInit = function() { var progressFill = $(el).find('.proggress'); var progressBar = $(el).find('.progressbar'); progressFill.css({ background: options.fillBackgroundColor, height: options.height, borderRadius: options.borderRadius }); progressBar.css({ width: options.width, background: options.backgroundColor, borderRadius: options.borderRadius }); progressFill.animate({ width: options.percentage + "%" }, { step: function(x) { if (options.ShowProgressCount) { $(el).find(".percentCount").text(Math.round(x) + "%"); } }, duration: options.duration }); } $(this).waypoint(lineProgressBarInit, { offset: '100%', triggerOnce: true }); }); } })(jQuery);