mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
[lozad] update tests for version 1.2
This commit is contained in:
@@ -8,6 +8,21 @@ const observer = lozad('.lozad', {
|
||||
|
||||
// Custom implementation to load an element
|
||||
// e.g. el.src = el.dataset.src;
|
||||
},
|
||||
loaded(el) {
|
||||
console.log('loaded element');
|
||||
}
|
||||
});
|
||||
observer.observe();
|
||||
|
||||
const singleElement = document.getElementById('hello');
|
||||
if (singleElement) {
|
||||
const observer2 = lozad(singleElement);
|
||||
observer2.triggerLoad(singleElement);
|
||||
}
|
||||
|
||||
const elementsCollection = document.getElementsByClassName('lozad');
|
||||
if (elementsCollection) lozad(elementsCollection);
|
||||
|
||||
const nodeList = document.querySelectorAll('.images');
|
||||
if (nodeList) lozad(nodeList);
|
||||
|
||||
Reference in New Issue
Block a user