View on GitHub

Lazynity

A lazy loader with infinity inside

Download this project as a .zip file Download this project as a tar.gz file

Lazynity


What's that ?

A jquery plugin for lazy loading.

For developers: this plugin was created with KISS & DRY principles in mind. Don't hesitate to fork the project and to improve the code.


Demos & Examples

Desktop

Mobile (jQuery Mobile)


How to use it ?

Lazynity depends on jQuery. Include them both in end of your HTML code:

<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.lazynity.js" type="text/javascript"></script>

HTML

<div id="wrapper">
  <ul id="mylonglist">
  </ul>
</div>

JS

$(document).bind("ready", function(){

    $.getScript("ais_120000_loc.js",function(){

        $('#mylonglist').lazynity({
            renderingFn:    Mustache.render,
            models:         ais_data,
            template:       "<li>{{mobileId}}</li>",
            height:         600,
            treshold:       40
        });

        $('#mylonglist').bind('rendered',function(){
            console.log('rendered');
        });

    });

});

CSS

No CSS hack needed.


Methods, Options and Events

Methods

$('#myul').lazynity( options );

Options

Events


License

This plugin is available under the Creative Commons License.