Skip to content

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.

License

Notifications You must be signed in to change notification settings

davidhirtz/yii2-lazysizes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-lazysizes extension

lazysizes is a fast (jank-free), SEO-friendly and self-initializing lazyloader for images (including responsive images picture/srcset), iframes, scripts/widgets and much more.

Installation

The preferred way to install this extension is through composer.

php composer.phar require --prefer-dist davidhirtz/yii2-lazysizes "*"

Usage

Once the extension is installed, simply use it in your views. The following example shows you how to add an lazysizes powered image tag.

\davidhirtz\yii2\lazysizes\AssetBundle::register($this);
echo \davidhirtz\yii2\lazysizes\Html::lazyImg($srcset, $options);

Upgrade from V1

Important: AssetBundle is no longer registered by calling Html::lazyImg().

About

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages