extranet/www/js/jqueryprogressbar.js

3 lines
492 B
JavaScript
Raw Normal View History

2009-03-02 14:25:00 +00:00
(function($){$.fn.reportprogress=function(val,maxVal){var max=100;if(maxVal)
max=maxVal;return this.each(function(){var div=$(this);var innerdiv=div.find(".progress");if(innerdiv.length!=1){innerdiv=$("<div class='progress'></div>");div.append("<div class='text'> </div>");$("<span class='text'> </span>").css("width",div.width()).appendTo(innerdiv);div.append(innerdiv);}
var width=Math.round(val/max*100);innerdiv.css("width",width+"%");div.find(".text").html(width+" %");});};})(jQuery);