-
Notifications
You must be signed in to change notification settings - Fork 0
/
runkitExample.js
executable file
·37 lines (35 loc) · 1.86 KB
/
runkitExample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const nativeLazyLoading = require('native-lazy-loading');
const html = `<img src="https://www.yasglobal.com/wp-content/themes/yasglobal/images-cus/logo.svg" alt="YAS Global Logo" title="YAS Global Logo" class="no-lazy"/>
<div class="white logos">
<div class="container">
<div class="testimonials">
<div class="item">
<img src="/wordpress-logo.svg" style="margin-top: -9px;" alt="WordPress Logo" title="WordPress Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/drupal-logo.svg" style="margin-top: -9px;" alt="Drupal Logo" title="Drupal Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/contentful-logo.svg" style="margin-top: -9px;" alt="Contentful Logo" title="Contentful Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/contentstack-logo.svg" style="margin-top: -9px;" alt="ContentStack Logo" title="ContentStack Logo" />
</div>
<div class="item">
<img src="/netlify-logo.svg" style="margin-top: -9px;" alt="Netlify Logo" title="Netlify Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/heroku-logo.svg" style="margin-top: -9px;" alt="Heroku Logo" title="Heroku Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/pantheon-logo.svg" style="margin-top: -9px;" alt="Pantheon Logo" title="Pantheon Logo" />
</div>
<div class="item">
<img src="/wpengine-logo.svg" style="margin-top: -9px;" alt="WPs Engine Logo" title="WP Engine Logo" class="testing-lazyload" />
</div>
</div>
<iframe src="https://www.w3schools.com" name="w3schools" class="testing-lazyload"></iframe>
</div>
</div>`;
console.log('Before applying Native Lazy Loading: ', html);
console.log('After applying Native Lazy Loading: ', nativeLazyLoading(html));