Added lazy loading support on wrapper elements#135
Open
tkosse wants to merge 4 commits intodinbror:masterfrom
Open
Added lazy loading support on wrapper elements#135tkosse wants to merge 4 commits intodinbror:masterfrom
tkosse wants to merge 4 commits intodinbror:masterfrom
Conversation
… class b-lazy and automatically all images/videos/iframes in this div get loaded all at once when the div is scrolled in the viewport.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solves #65
and also somehow solves #103
Now you can do the following:
All lazy loadable elements in the div get loaded automatically all at once when the div appears in the viewport. When all elements have been loaded a specified success or error function will only be executed once. I tried to implement it as general as possible by keeping the actual behaviour.
I couldn't find any library that would support this so it seems to be pretty unique but however really powerful. I need this behaviour i. e. for libraries like BalancedGallery where the images get arranged in a nice way after they have been loaded.
Complex example:
Every time a div scrolls in the viewport all images inside get loaded and after that they get displayed in a nice way. This creates an "endless" scrolling effect on the gallery without loading all images on page load.
If PR is accepted I could also update the documentation.
If there are any questions feel free to ask me.