, , ,

Lazy Load XT : jQuery plugin for lazy loading of images, videos and other media

Mobile-oriented, fast and extensible jQuery plugin for lazy loading of images and videos with build-in support of jQueryMobile framework.

Download: https://github.com/ressio/lazy-load-xt

Demonstration: http://ressio.github.io/lazy-load-xt/demo/

Plugin homepage: https://github.com/ressio/lazy-load-xt

Implementation:

1. Include jquery.lazyloadxt.min.js:

<script src="jquery.lazyloadxt.min.js"></script>

2. Replace src attribute in your es to data-src. Optionally add a placeholder src and a fallback image (in the latter case it’s necessary to mark first image with class=”lazy”, see item 3 below):

<img class="lazy" data-src="lazy.jpg" width="100" height="100">
<noscript><img src="lazy.jpg" width="100" height="100"></noscript>

It’s recommended to keep the order of attributes in both  tags, such a code will be effectively gzipped.

3. If you use fallback image, hide first image using CSS (otherwise browsers with disabled javascript will display both images):

img.lazy {
  display: none;
}

Lazy Load XT plugin removes this class (classNojs option) at image initialization.

Options:

Screenshots:

Creating a JavaScript Library

I recently wrote a JavaScript library for creating random colors and color schemes, and while I foun…

s3Slider jQuery Plugin & Tutorial

The s3Slider jQuery plugin is made by example of jd`s smooth slide show script. Usage: HTML: Sample …

jQuery Optimization: Avoid Unnecessary Selector

Common subexpression elimination is a common way to optimize any programming code. Doing unnecessary…

Fading Links Using jQuery: dwFadingLinks

Earlier this month, we posted a MooTools script that faded links to and from a color during the mous…

jQuery Flash Plugin

This jQuery plugin is for embedding Flash movies. Pages are progressively enhanced when Flash and Ja…

jQuery Optimization: Optimize Selector

We can also optimize our selector other than being a bit specific on our selector. The key to optimi…

jQuery drop down menu: droppy

Quick and dirty nested drop-down menu in the jQuery style. I needed a nav like this for a recent pro…