( ... items )
Tools
Register Login

Joomla! Wordpress & Drupal Extension Development - Codextension - We are Freelancers

You are here: Home » Our Porfolios » jQuery plugins » jQuery Lazyload
Monday, 21 May 2012
Sunday, 05 September 2010 04:56

jQuery Lazyload

Rate this item
(5 votes)
Lazyload is a jQuery plugin improved load images in the site long. External image frame will only show when users drag to. Using the site Lazyload in length with multiple images will make pages load faster, in some cases it also helps reduce the load to the web server.

Usage

First you need to download jQuery and Lazyload plugin. Then add in your card <head> site:

<!-- Library jQuery -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<!-- jQuery Lazy Load -->
<script type="text/javascript" src="js/jquery.lazyload.pack.js"></script>
<script type="text/javascript">
  $(function() {
    $("img").lazyload(); // lazyload all image on page
  });
</script>


HTML

Lazyload offer some choice as to load a portion of the image, using image replacement, call the event, when a picture effect, set the time to upload photos ... You can see the homepage of the farms lazyload

The following code will load first 200px of the image before the image appears

$("img").lazyload({ threshold : 200 });



Using image replacement

$("img").lazyload({ placeholder : "img/grey.gif" });





Default :

Photo accompany replacement plugin 1x1px gif image, you can replace it with your own picture links
When using blur effect appears

$("img").lazyload({ 
    placeholder : "img/grey.gif",
    effect : "fadeIn" 
});


Download


Last modified on Sunday, 05 September 2010 05:54
codextension

codextension

We are codextension. We are Web Developer from ha noi, Vietnamese.

Website: codextension.com E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.