Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to target the nProgress loading bar?

I have a website that is very image heavy so loading time is a bit slower than the norm.

I resize images once they are all loaded. However, I am wanting to give an indication to the user that the images are still loading.

Using the imagesLoaded library, i have managed to get the nprogress bar working perfectly, but I want to be able to target a div for the loading bar to go into.

If this is not possible its not a problem, I'l just use spin.js or similar.

like image 527
Lovelock Avatar asked Jan 21 '26 10:01

Lovelock


1 Answers

NProgress author here. This is now possible with the latest version.

NProgress.configure({ parent: "#your_container_here" });

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 see:

  • https://github.com/rstacruz/nprogress/blob/master/History.md#v016---june-25-2014
  • https://github.com/rstacruz/nprogress#parent
like image 101
Rico Sta. Cruz Avatar answered Jan 24 '26 00:01

Rico Sta. Cruz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!