progress.js
progress.js copied to clipboard
Suggestion: autoRemove don't remove, just stops.
autoRemove does more than just removing. It does the internal timer cleaning. But what about doing the cleaning but letting the bar visible (i.e. do not remove it),.
I did this very simple: add a property like justStop, set it as true and add this code:
function remove(callback) {
window.clearInterval(intervals['backgroundAnimation']);
//hgc 1-oct-2015
//this way the bar will stay but animation will stop consuming resources.
if (config.justStop) return;
var renderedProgressBar = document.getElementById(config.id);
renderedProgressBar.parentNode.removeChild(renderedProgressBar);
}