Skip to content

macem/lazy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lazy

jquery and zepto plugin for lazy load image, video

How it works:

the idea is to replace link to img or to iframe and show it when is in view.

Config:

{
  init      : function (node) {}, // after replace tag we can run callback 
  loadClass : 'load', // class added to original link tag before replacement
  tag       : 'img'   // replace original link to this tag
}

Example:

  1. Load image

<a href="*.jpg" class="lazy">my new car image</a>

$('a.lazy').lazy();

  1. Load video from youtube

<a class="lazy-frame" href="http://www.youtube.com/embed/uahfKA-vU8M"&gt;Video&lt;/a>

$('a.lazy-frame').lazy({tag: 'iframe'});

About

jquery plugin for lazy load image, video

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published