extranet/www/js/jqueryprogressbar.js
2009-08-05 09:37:18 +00:00

19 lines
573 B
JavaScript

(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);