Add aProgress.js to your project.
Simply call:
AProgress.start()
when AJAX/XMLHTTPRequest startsAProgress.done()
when AJAX/XMLHTTPRequest ends (calling success/error callback)
You can always change settings of your progress bar simply by calling AProgress.config
(Note: changing styles of the bar can cause some mess, so do it carefully! Note to myself: try to hide bar's CSS).
- Change number of dots:
AProgress.config({numberOfDots: NEW_NUMBER});
- Change selector's name (for example: bar):
var oldBar = AProgress.settings.bar,
newBar = {};
newBar.selectorSign = oldBar.selectorSign;
newBar.css = oldBar.css;
newBar.selectorName = 'NEW_SELECTOR_NAME';
AProgress.config(bar: newBar);