yiidoc/yii2-lazyload
Composer 安装命令:
composer require yiidoc/yii2-lazyload
包简介
Extension redactor for Yii2 Framework.
README 文档
README
Extension LazyLoad for Yii2 Framework.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiidoc/yii2-lazyload "*"
or
"yiidoc/yii2-lazyload": "*"
to the require section of your composer.json.
Configure
Default use LazyWidget automatic render with options attributes img html tag and configure client scripts
use yiidoc\lazyload\LazyWidget;
...
<?=LazyWidget::widget();
or manual generate img tags
use yiidoc\lazyload\LayzAsset;
LayzAsset::register($view); // $view instanceOf yii\web\View
$js = "jQuery('img.img-lazy').lazyload();";
$view->registerJs($js);
//manaul generate img tag
Html::img($blank-img,['class'=>'img-lazy','data-src'=>$url]);
Bummer! i was tested on my project but not have many time to write document on file and usage. If you have problem please create a issue
Thanks!
统计信息
- 总下载量: 241
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-10-03