question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nprogress multi instance

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:19
  • Comments:11

github_iconTop GitHub Comments

16reactions
heruancommented, Apr 4, 2016

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();
3reactions
RamyRaiscommented, Jul 14, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

multi-nprogress - npm
Simple slim progress bars. Latest version: 0.3.5, last published: 2 years ago. Start using multi-nprogress in your project by running `npm i ...
Read more >
NProgress: slim progress bars in JavaScript - Rico Sta. Cruz
A nanoscopic progress bar. Featuring realistic trickle animations to convince your users that something is happening! NProgress.start() — shows the progress bar.
Read more >
rstacruz/nprogress - Gitter
I am trying to get the bar to work in a div with an id='progress1' so I used nprogress.configure({parent: '#progress1'}) in my javascript....
Read more >
Is it possible to target the nProgress loading bar?
Keep in mind however that NProgress doesn't support having multiple progress bars per page (which isn't a very good use case anyway). Also...
Read more >
@tanem/react-nprogress examples - CodeSandbox
Learn how to use @tanem/react-nprogress by viewing and forking example apps that make use of ... multiple-instancesReactNProgress Multiple Instances Example.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found