1
0
Fork 0
forked from 0x2620/oxjs

add Ox.Progressbar

This commit is contained in:
rlx 2011-09-01 09:35:45 +00:00
commit 2a9053a588
4 changed files with 50 additions and 1 deletions

View file

@ -0,0 +1,31 @@
Ox.Progressbar = function(options, self) {
self = self || {};
var that = Ox.Element({}, self)
.defaults({
progress: 0,
width: 256
})
.options(options || {})
.addClass('OxProgressbar')
.css({width: self.options.width});
self.$progress = $('<div>').appendTo(that);
setProgress();
function setProgress() {
self.$progress.css({
width: Math.round(16 + self.options.progress * (self.options.width - 16)) + 'px'
});
}
self.setOption = function(key, value) {
if (key == 'progress') {
setProgress();
}
}
return that;
};