function skProgressBar(pbar, settings) { this.container = $("#" + pbar); this.container.append("
"); this.bar = $("#" + pbar + " div"); this.bar.css("height", "100%"); this.pbarWidth = this.container.width(); this.pbarMax = 100; this.container.css("border-style", "solid"); if (settings.maxValue) this.pbarMax = settings.maxValue; if (settings.borderWidth) this.container.css("border-width", settings.borderWidth); if (settings.borderColor) this.container.css("border-color", settings.borderColor); if (settings.color) this.bar.css("background",settings.color); this.update(0); } skProgressBar.prototype.anim = function() { } skProgressBar.prototype.update = function(newVal) { if (newVal <0) newVal = 0; if (newVal <= this.pbarMax) { this.percent = (newVal/this.pbarMax)*100; this.bar.width(this.percent + "%"); } }