6 ms·
One difference from yesterday's example is that it will get to 100% without 'complete' firing.
by gstar 13y ago
One difference from yesterday's example is that it will get to 100% without 'complete' firing.
- diggan 13y agoYeah, I'm not sure that the progressbar should disapear just because the width is 100% because the loading still can be unfinished. Therefore you should always call progressbar.complete() after the loading is done. Please let me know what you think would be best.
- gstar 13y agoI think you missed a subtlety of nprogress, where it never fills the last 10 (or so) pixels unless complete is fired, presumably so that it doesn't make you think loading is finished until it's really, really finished.
- diggan 13y agoOh, yes, I totally missed that and that seems very reasonable actually. I've now changed (commit 34e3c16 http://git.io/4MeJNg http://git.io/4MeJNg) so the start-method will stop at 95% instead of stopping at 100%.
- bib971 13y agoOne technique that I used when building my own progress indicator is using a maths function which approaches 0 as the progress bar approaches 100% and use the result to increase the progress. That way, the progress bar appears moving slower and slower but never actually hits 100%. I think that's better than having the progress bar completely stalled at 95%. See code here: https://github.com/buunguyen/rainbow.js/blob/master/src/rainbow.js#L97 https://github.com/buunguyen/rainbow.js/blob/master/src/rain....