Question

I've searched but haven't been able to find out a way to preload images using Bootstrap Carousel. I am building up a portfolio site with a lot of images and right now Bootstrap carousel works properly after all the images are loaded.

Any ideas?

Was it helpful?

Solution

I'm pretty sure that the images in the Bootstrap carousel aren't loaded dynamically, but loaded with the page. Therefore there isn't any reason for you to preload.

Preloading is used when images are loaded onto the page dynamically. When this happens, the page has to load this image separate from the page, causing an undesirable lag between dynamic addition and image downloading/appearing.

Because bootstrap's carousel has it's images included in the HTML and simply hidden with javascript, the images are loaded with the page, resulting in whatever preloading would achieve for you.

tl;dr: You can't it's already done for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top