2

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?

Dmonix
  • 1,155
  • 7
  • 13
Johann
  • 681
  • 3
  • 13
  • 30

1 Answers1

4

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.

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
Joseph Szymborski
  • 1,241
  • 2
  • 17
  • 31
  • Hi Joseph, this is not correct. It is not the same to load 50 images at the same time than loading 5 images at the time. – Johann Apr 05 '13 at 01:24
  • @Johann I'm afraid I don't understand what you mean. The goal of preloading is to load images before the website is shown.That means that you are loading ALL of the websites images at once. That is what is meant by preloading. Preloading does not mean, to load the images "5 at a time" as opposed to "50 at a time". In fact, it means the opposite. You're talking about dynamically loading the images on request, which can be advantageous to page performance. This site explains what preloading means well: http://is.gd/UPzT1Q – Joseph Szymborski Apr 05 '13 at 02:25
  • @Leniel Macaferi Thanks for the save. – Joseph Szymborski Oct 22 '13 at 06:12