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

lousy-load

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lousy-load

JavaScript lazy load plugin with responsive image support

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Lousy Load

Build Status

Lousy Load is a JavaScript lazy loading plugin for images. End of speech.

Install

npm install --save lousy-load # npm
yarn add lousy-load           # yarn

Or download the latest release

Basic Examples

Vanilla JavaScript

<img data-src="path/to/image.jpg" width="400" height="300">
        
<script src="lousy-load.min.js"></script>
<script>
    var ll = new lousyLoad(document.body);
</script>

jQuery

<img data-src="path/to/image.jpg" width="400" height="300">
        
<script src="lousy-load.min.js"></script>
<script>
    $('body').lousyLoad();
</script>

Advanced Example

<img 
    class="ll-image"
    data-src="path/to/image.jpg"
     width="400"
     height="300">

<img 
    data-nowrap
    class="ll-image"
    data-src="path/to/image2.jpg"
    width="400"
    height="300">
        
<script src="lousy-load.min.js"></script>
<script>
    var ll = new lousyLoad(document.body, {
        selector : '.ll-image',
        threshold : 100,
    });
</script>

Usage

Syntax

Vanilla JS

new lousyLoad([container[, options]])

jQuery

$(container).lousyLoad([options]);

container

container is the DOM element that contains the images you want to lazy load.

options

threshold number - Number of pixels above and below the viewport Lousy Load will check for images.

selector string - Selector Lousy Load will use to populate list of lazy loaded images.

wrapElement boolean - If true images will be wrapped in a span tag. Useful for loading transitions.

Keywords

FAQs

Package last updated on 10 Sep 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