vanilla-lazyload
loading-attribute-polyfill
Our great sponsors
vanilla-lazyload | loading-attribute-polyfill | |
---|---|---|
9 | 4 | |
7,539 | 613 | |
- | - | |
5.6 | 5.5 | |
about 19 hours ago | 21 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
vanilla-lazyload
-
How to Lazy Load Html Videos
Vanilla-lazyload :
-
Beginners Guide to Web Performance: Optimizing Images
If you want to guarantee lazy-load across all (JavaScript-capable) browsers and not just images, I've used Vanilla Lazyload a couple years ago with success, but as this relies on using a data-src attribute, you will get W3C validation errors unless you also set a src attribute. But you don't want to set the src to a real image, because this will nullify the whole point of using the plugin, so set it to a 1x1 pixel "image" that will immediately get replaced by the data-src once the image scrolls into view.
-
Native lazy-loading of images with zero Javascript
There are a lot of snippets and scripts like vanilla-lazyload out there that enable lazy-loading via javascript. In almost all cases a data attribute is used to prevent upfront image loading.
-
LQIP in Rails using Thumbor and base64
Right, time to put the base64 images to use. What you want to do is to use these as placeholders while the full image is loading. I usually use vanilla-lazyload for this. It is a simple and tiny project that gets the job done. Do mind that if you use Turbolinks you have to make sure that vanilla-lazyload does its thing after Turbolinks is done. If you use Webpacker it will look something like this in your application.js file:
loading-attribute-polyfill
-
Improving your web performance
If you want to know which browsers accept this new attribute you can check it out at CanIuse In case most of your users use a browser that doesn't have this attribute implemented yet you can always use a polyfill, I recommend this Polyfill
-
Native lazy-loading of images with zero Javascript
Browsers that do not support the loading attribute simply ignore it without any side-effects. Fortunately, there is a polyfill at Github available named loading-attribute-polyfill which can be used in those cases.
-
🔥 Native lazy loading is here!
I recommend using a polyfill in addition to this: https://github.com/mfranzke/loading-attribute-polyfill
What are some alternatives?
splide - Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.
lazysizes - High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
sveltekit-simple-image-gallery - Simple Svelte responsive image gallery: create a ribbon gallery, using Svelte dimension bindings to maintain the aspect ratio of all images.
react-lazy-load-image-component - React Component to lazy load images and components using a HOC to track window scroll position.
Glide.js - A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more
webp-hero - browser polyfill for the webp image format
ImageOptim - GUI image optimizer for Mac
ElementsJS - A lightweight DOM Manipulation library for VanillaJS
ailog - An attendance log for Kizuna AIs' videos for when love-pii held the AI identity.
Vanilla-DataTables - A lightweight, dependency-free javascript HTML table plugin
sqip - "SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
kind-stranger - [NEW] Minimalistic React + Redux Mobile Reddit Viewer