Instead of lazy loading image alone,i need to add lazy load for entire div element in my page.
Can you anyone help me out with some plugins or own js code.
You can use this plugin. Its helpful and will do the trick for you.
https://github.com/emn178/jquery-lazyload-any
Just use this script as shown in documentation.
<div id="you-want-lazyload">
<!--
<p>Anything you want to lazyload</p>
-->
</div>
$('#you-want-lazyload').lazyload(options);
Hope it will help.
HTML Attribute Style
<div id="you-want-lazyload" data-lazyload="<p>Anything you want to lazyload</p>">
</div>
<div id="you-want-lazyload">
<script type="text/lazyload">
<p>Anything you want to lazyload</p>
</script>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With