Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lazysizes

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazysizes

High performance (jankfree) lazy loader for images (including responsive images), iframes and scripts (widgets).

  • 4.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
225K
decreased by-4.52%
Maintainers
1
Weekly downloads
 
Created

What is lazysizes?

lazysizes is a high-performance lazy loader for images (including responsive images), iframes, and scripts. It helps improve the performance of web pages by deferring the loading of non-critical resources until they are needed.

What are lazysizes's main functionalities?

Lazy Loading Images

This feature allows you to lazy load images by using the 'data-src' attribute instead of 'src'. The 'lazyload' class triggers the lazy loading functionality.

<img data-src='image.jpg' class='lazyload' alt='Lazy loaded image'>

Responsive Images

This feature enables lazy loading of responsive images using the 'data-srcset' and 'data-sizes' attributes. The 'lazyload' class ensures that the appropriate image is loaded based on the viewport size.

<img data-sizes='auto' data-srcset='image-320w.jpg 320w, image-640w.jpg 640w' data-src='image-640w.jpg' class='lazyload' alt='Responsive lazy loaded image'>

Lazy Loading Iframes

This feature allows you to lazy load iframes by using the 'data-src' attribute instead of 'src'. The 'lazyload' class triggers the lazy loading functionality.

<iframe data-src='https://www.example.com' class='lazyload'></iframe>

Lazy Loading Background Images

This feature allows you to lazy load background images by using the 'data-bg' attribute. The 'lazyload' class ensures that the background image is loaded only when the element is in the viewport.

<div class='lazyload' data-bg='image.jpg'></div>

Other packages similar to lazysizes

Keywords

FAQs

Package last updated on 23 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc