modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
20 lines (18 loc) • 483 B
JavaScript
/*!
{
"name": "image and iframe native lazy loading",
"property": "lazyloading",
"caniuse": "loading-lazy-attr",
"tags": ["image", "lazy", "loading"],
"notes": [{
"name": "Native image lazy-loading for the web",
"href": "https://addyosmani.com/blog/lazy-loading/"
}]
}
!*/
/* DOC
Test for the loading attribute of images and iframes
*/
define(['Modernizr'], function (Modernizr) {
Modernizr.addTest('lazyloading', 'loading' in HTMLImageElement.prototype);
});