xj/yii2-lazyload-widget

yii2-lazyload-widget

1.9.6 2015-05-17 15:00 UTC

This package is auto-updated.

Last update: 2024-11-10 20:01:14 UTC


README

http://www.appelsiini.net/projects/lazyload

composer.json

"require": {
        "xj/yii2-lazyload-widget": "*"
},

In View

<img class="lazy" data-original="img/example.jpg" width="640" height="480">
use yii\web\View;
use xj\lazyload\LazyloadAsset;
LazyloadAsset::register($this);
$this->registerJs('$("img.lazy").lazyload();'
        , View::POS_READY);

In Assets depends

public $depends = [
    'xj\lazyload\LazyloadAsset',
];