rstacruz / nprogress

For slim progress bars like on YouTube, Medium, etc
http://ricostacruz.com/nprogress
MIT License
25.97k stars 1.81k forks source link

nprogress multi instance #131

Open oussama-benmahmoud opened 8 years ago

oussama-benmahmoud commented 8 years ago

Hi, Is it possible to instantiate nprogress multiple time, I wanted to use it in different DOM elements not globally?

Here's what I've done:

$.ajax({
....
beforeSend: function(data) {
   NgProgress.configure({ parent: '#'+element});
   NgProgress.start();
},
success: function(response) {
   NgProgress.done();
}

If I call Ajax in different DOM to get some data, the nprogress will be used one time in one place only for the first ajax call.

heruan commented 8 years ago

This would be great and I'm also looking for a feedback of this being possibile.

Something like this:

var bodyElement = document.body;
var bodyNProgress = new NProgress(bodyElement);

var otherElement = document.getElementById("other");
var otherNProgress = new NProgress(otherElement);

bodyNProgress.start();
ArmorDarks commented 7 years ago

Would be great to have such feature

artboard-studio commented 7 years ago

There should be such feature, for now, you can run the NgProgress.configure every time you want to run NgProgress.start for each instance, not a great solution but works in my react app.

RamyRais commented 7 years ago

This PR will enable you to have multi instance #179

ISkomorokh commented 7 years ago

Any feedback on this?

alokrajiv commented 6 years ago

Any updates on this? Thanks!!

annezao commented 6 years ago

check this out http://pchiwan.github.io/nprogress/

EgoPingvina commented 3 years ago

And is it real now?

samstr commented 2 years ago

want

RamyRais commented 2 years ago

if you are looking just for this feature, i have it in a forked package https://www.npmjs.com/package/multi-nprogress

hemengke1997 commented 2 years ago

if you are looking just for this feature, i have it in a forked package https://www.npmjs.com/package/multi-nprogress

goodjob!