Skip to content

xolf/lazyjs

Repository files navigation

LazyJS

Lazy loading for elements

Installation

Include the LazyJS javascript file.

<script src="lazy.js"></script>

Link to the LazyJS stylesheet, if you're using our animations.

<link href="lazyjs.css" rel="stylesheet">

Example

LazyJs({"animation": "blockroll"});
<div id="example" class="lazyjs" data-origin="http://example.com"></div>

This example will create an animation in the example container while LazyJS is loading the data from http://example.com.

Animation

LazyJS can display some animations for your during the content is loading.

LazyJs({"animation": "windows8"});

Some available animatios are:

  • windows8
  • blockroll
  • thecube

Technical stuff

Command for minifying JavaScript java -jar yuicompressor-2.4.8.jar lazy.js -o lazy.min.js