<srcset-image>
Polyfill for srcset feature as Web Components.
Load srcset-image.js
in your HTML.
<script src='srcset-image.js'></script>
Modify your <img>
elements such as following (srcset feature specification).
<img is='srcset-image' src='image.jpg' srcset='image-1.5x.jpg 1.5x, image-2x.jpg 2x'>
If browser does not support document.registerElement()
, Images will be loaded as usual.
MIT