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

lozad

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lozad

A light-weight JS library to lazy load any HTML element such as images, ads, videos etc.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by0.56%
Maintainers
1
Weekly downloads
 
Created
Source

Lozad npm version

Advanced Lazy Loader using Intersection Observer API


lozad.js is a light-weight library to lazy load elements using JavaScript.

It is written with an aim to lazy load images, ads, videos or any other element using the recently added Intersection Observer API with tremendous performance benefits.

Installation

lozad.js is just 569 bytes minified & gzipped.

  • Bower: bower install lozad
  • NPM: npm install lozad
  • Download zip.

Note: lozad.js supports AMD and commonJS module pattern out of the box.

Usage

new Lozad(); // lazy loads images with selector class as 'lozad'

with custom options:

new Lozad({
    selectorClass: 'lozad', // for identification of images to lazy load
    rootMargin: '10px 0px', // syntax similar to that of CSS Margin
    threshold: 0.1 // ratio of image convergence
})

Reference:

Browser Support

Available in latest browsers. If browser support is not available, then make use of this polyfill.

Contributing

Interested in contributing features and fixes?

Read more on contributing.

Changelog

See the Changelog

License

Copyright (c) 2017 Apoorv Saxena, https://apoorv.pro Licensed under the MIT license.

Keywords

FAQs

Package last updated on 28 Aug 2017

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