We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a21b7d5 commit fce352fCopy full SHA for fce352f
loading-attribute-polyfill.js
@@ -10,7 +10,7 @@
10
* Use an IntersectionObserver polyfill in case of IE11 support necessary.
11
*/
12
13
-(function (noscriptClass, rootMargin) {
+const lazyload = function (noscriptClass = 'loading-lazy', rootMargin = '256px 0px') {
14
'use strict';
15
16
var config = {
@@ -236,7 +236,9 @@
236
237
function prepareElements() {
238
//
239
- var lazyLoadAreas = document.querySelectorAll('noscript.' + noscriptClass);
+ var lazyLoadAreas = document.querySelectorAll(
240
+ 'noscript.' + config.noscriptClass
241
+ );
242
243
lazyLoadAreas.forEach(prepareElement);
244
@@ -260,4 +262,8 @@
260
262
}
261
263
});
264
-})('loading-lazy', '256px 0px');
265
+};
266
+
267
+lazyload();
268
269
+export default lazyload;
0 commit comments