Console

0 / 10 elements loaded

Example: Callback Functions

The Lazy plugin delivers four callback functions, which get triggered on different points of loading an element.
You can use them to extend the functionality of the plugin and may get a more dynamic experience fou you and your users.

All you need is to set a function to the beforeLoad, afterLoad, onError and/or onFinishedAll config option.
Lazy will pass the current jQuery element as function parameter to the callback, so you can directly handle them.

You may have noticed the left sidebar in all of the Lazy examples and the output in your browsers console.
The update of the sidebar and the data is even realized with this callback functions.