Get started with lazyad-loader CDN
MIT licensed
Library, LazyADLoader: Delays ad loading until viewport, enhances page load times, user experience.
Tags:- ads
- lazy-load
- async
- responsive
Stable version
Copied!
How to start using lazyad-loader CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with lazyad-loader CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>
<script src="https://cdn.cdnhub.io/lazyad-loader/1.1.12/lazyad-loader.min.js"></script>
<style>
img.lazy {
width: 100%;
height: auto;
object-fit: cover;
opacity: 0;
}
</style>
</head>
<body>
<img class="lazy" data-src="image1.jpg" alt="Image 1" />
<img class="lazy" data-src="image2.jpg" alt="Image 2" />
<img class="lazy" data-src="image3.jpg" alt="Image 3" />
<script>
document.addEventListener('DOMContentLoaded', function() {
LazyLoad.init({
elements_selector: ".lazy"
});
});
</script>
</body>
</html>