gevman/yii2-html-lazyload

Yii2 Lazy load Widget for html blocks

1.2.1 2017-10-13 22:43 UTC

This package is auto-updated.

Last update: 2024-11-21 03:01:20 UTC


README

Installation (using composer)

composer require gevman/yii2-lazyload
Example
<?php \Gevman\LazyLoad\LazyBlock::begin([
    'effect' => \Gevman\LazyLoad\LazyBlock::EFFECT_ZOOM_IN,
    'speed' => 600, //default = 600 (time in miliseconds)
    'delay' => 10 //default = 0 (time in miliseconds)
]); ?>

<div class="container">
    <div class="row">
        <div class="col-md-4">
            <p><?=\yii\helpers\Html::encode($page->content)?></p>
        </div>
        <div class="col-md-4">
            <p><?=\yii\helpers\Html::encode($page->content)?></p>
        </div>
        <div class="col-md-4">
            <p><?=\yii\helpers\Html::encode($page->content)?></p>
        </div>
    </div>
</div>

<?php \Gevman\LazyLoad\LazyBlock::end(); ?>
Effects
  • EFFECT_SLIDE_UP
  • EFFECT_SLIDE_DOWN
  • EFFECT_SLIDE_FROM_LEFT
  • EFFECT_SLIDE_FROM_RIGHT
  • EFFECT_ZOOM_IN
  • EFFECT_ZOOM_OUT
  • EFFECT_ROTATE
  • EFFECT_SKEW