神刀安全网

<lazyload-image> now uses IntersectionObserver!

HTMLImageElement extension for lazy loading.

Installation

# via npm $ npm install lazyload-image  # via bower $ bower install lazyload-image

Usage

Load lazyload-image.html in your HTML.

<link rel="import" href="lazyload-image.html">

Modify your <img> elements such as following.

<img is="lazyload-image" src="path/to/your/image.jpg" width="100" height="100">

Fallback

If browser does not support document.registerElement() , Images will be loaded as usual.

Demo

Recommend you to open DevTools’s Elements tab to see behavior of <lazyload-image> .

&lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver! &lt;lazyload-image&gt; now uses IntersectionObserver!

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » <lazyload-image> now uses IntersectionObserver!

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址