Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1.09 KB

README.md

File metadata and controls

40 lines (23 loc) · 1.09 KB

Lazyload-Rails Build Status

This project integrates the jQuery Lazy Load Plugin for Rails image_tag helpers

Documentation

Features

  • Automatically get Rails image_tag helpers to render lazyload-friendly html img tags.
  • Simple, really. That's pretty much it.

Example

<%= image_tag "kittenz.png", alt: "OMG a cat!" %>

Equals:

<img alt="OMG a cat!" data-original="/images/kittenz.png" src="http://www.appelsiini.net/projects/lazyload/img/grey.gif">

Install

Add this line to your application's Gemfile:

gem "lazyload-rails"

Download the jQuery Lazy Load Plugin into your vendor/assets/javascripts directory and include it however you prefer.

Important: Remember that the Lazy Load Plugin depends on jQuery.

FAQ

  • Q: How can I use the old image_tag method?
  • R: Try with x_image_tag

License

Lazyload-Rails is released under the MIT License.