A slim progress bar with no dependencies. Similar to nprogress.
<script src="mprogress.js"></script>
var mprogress = new MProgress();
mprogress.interval().show();
// do stuff
mprogress.hide();
MProgress([styles])
: Constructor function. styles
is a object containing HTMLElement.style properties, used to override the default style.interval([interval])
: Create a timer that calls increase()
with a default interval
of 500ms. Automatically removed in remove()
.show()
: Append element to body.hide()
: Finish progress bar and call remove()
.remove()
: Remove element from body and detach timers.set(value)
: Set current progress to percentage value
.get()
: Return current percentage value.increase([value])
: Increase progress bar value. If value
is not passed, a random value is chosen.All functions that don't return a value are chainable.