Pre-loading Images

Page: 1

Author Post
Member
Registered: Jan 2012
Posts: 98
I use Floatbox to display a gallery of images. This appears to operate using ajax or something similar as an inspection of the http requests shows that only the first three images load when the page loads. Obviously this is much better than loading them all, but if I could reduce the number of images that pre-load I could possibly cut my overall page loading time by nearly a second. Is this possible?
Administrator
Registered: Aug 2008
Posts: 3382
The number of images preloaded can be controlled with the preloadLimit option.

Tweaking this setting will have no effect on page load time because image preloading does not begin until after the page is fully loaded and rendered.
Member
Registered: Jan 2012
Posts: 98
I take your point about the preloading happening after onload. Iwas trying to reduce the time taken for everything to be loaded but perhaps it doesn't matter. It shows up clearly on webpagetest.org because the three images are the very last things to load. But I suppose users will never really notice that.

Anyway I haven't been able to get it to work. I tried it in global options in options.js, and also in data-fb-options in the link.
Administrator
Registered: Aug 2008
Posts: 3382
options.js and not fbOptions.js??? Sounds like you're using an older version of Floatbox. Either upgrade to the latest/greatest or check the docs folder in the package you're using. I think a similar option was called 'preloadImages', but I'm not 100% on that.
Member
Registered: Jan 2012
Posts: 98
Yes I know I should upgrade to the latest and greatest, but I find V6.10 is great enough. There are so many things to spend my time on, that I don't want to indulge in this one until I have to.

I did check the docs for 6.10 and the same instructions were there, just like on the website.
Administrator
Registered: Aug 2008
Posts: 3382
The instructions.html documents are similar between versions 6.1.0 and 7.4.0, but not identical. The 'preloadLimit' option (and all others) is documented in the Options Reference (options.html), and not in the Instructions document.

Diving into my archives, I see that 'preloadLimit' was called 'preloadLimit' in 6.1, and operates in a similar fashion to version 7. To determine why it's not working for you, I would need to see a live page and dissect the problem in context.

Page: 1