Lazy loading loads all images at once

smares's Avatar

smares

29 Aug, 2012 06:09 AM

Hi there!

I assumed that lazy loading would only load a few images and transfer the remaining ones as soon as the user navigates through the slider. Happens on my side with a 200 images gallery though, is that Firefox starts 200 GET requests for all images and hangs a few seconds while downloading everything. Am I doing something wrong? What I am doing is generating a string that looks like this:

'<a class="rsImg" href="' + path + '" data-rsTmb="' + thumbnail + '">' + caption + '</a>'

where path is the large image path, thumbnail is the thumbnail path and caption is the text to be displayed. This string is passed to slides when initializing the slider.

Cheers,
Sebastian

  1. Support Staff 1 Posted by Dmitry Semenov on 29 Aug, 2012 07:33 AM

    Dmitry Semenov's Avatar

    Hi

    If you use this markup, there souldn't be any problems, can you send me link to page?

    Dmitry

  2. 2 Posted by smares on 29 Aug, 2012 07:40 AM

    smares's Avatar

    http://smares.de/photos.php with smares / smares as login.

  3. 3 Posted by smares on 29 Aug, 2012 08:24 AM

    smares's Avatar

    Just noticed that it's not picking up the thumbnails for generating the thumbs, but the actual images, so it seems that I cannot use the data-rsTmb attribute in the a tag. If I use img-Elements for the thumbs, I guess that would make RS load the right images, but it would still load all thumbs at once.

    Edit: Meh, my fault regarding the thumbs, I forgot to adapt the path in the JS so currently, thumbs and full images are the same. Sorry!

    This leads me to a feature-request though... Is it possible to have some sort of lazy-loading for the thumbs that loads only the visible images x 2 for example and fetches the other thumbnails only when scrolling the thumbs-strip?

  4. Support Staff 4 Posted by Dmitry Semenov on 29 Aug, 2012 12:02 PM

    Dmitry Semenov's Avatar

    Hi,

    Unfortunately, thumbnails are not lazy-loaded (mainly because of performance, no-js and SEO reasons), and currently there are no plans about implement this feature.

    200 images per slider with thumbnails is way too much, try to separate galleries by categories and optimize images.

    Dmitry

  5. 5 Posted by smares on 29 Aug, 2012 12:04 PM

    smares's Avatar

    Any plans to add support for sprites? :D

  6. Support Staff 6 Posted by Dmitry Semenov on 29 Aug, 2012 12:13 PM

    Dmitry Semenov's Avatar

    Sprites for what? For thumbnails?

    Dmitry

  7. 7 Posted by smares on 29 Aug, 2012 12:15 PM

    smares's Avatar

    Right. :) I guess loading one larger image is better than many small ones.

  8. Support Staff 8 Posted by Dmitry Semenov on 30 Aug, 2012 06:33 AM

    Dmitry Semenov's Avatar

    It is, but see my prev message - SEO, no-js.

    Dmitry

  9. Dmitry Semenov closed this discussion on 30 Aug, 2012 06:33 AM.

  10. smares re-opened this discussion on 30 Aug, 2012 07:35 AM

  11. 9 Posted by smares on 30 Aug, 2012 07:35 AM

    smares's Avatar

    I agree, but when adding slides via JS (the slides property), no-js and SEO doesn't matter anyways. :)

  12. Dmitry Semenov closed this discussion on 30 Aug, 2012 09:15 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac