xj / yii2-lazyload-widget
yii2-lazyload-widget
Installs: 5 298
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 6
Forks: 6
Open Issues: 0
Requires
- bower-asset/jquery.lazyload: ~1.9.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-10 19:52:00 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', ];