Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
init the library
$(document).ready(function () { var bLazy = new Blazy({}); });
my html img:
<img class="b-lazy" data-src="./imgs/home/banner_png.png" alt="">
note: no errors in the console, and I tried logging the bLazyobject it logged in my console
note: I tried Using this code didn't print anything in my console:
var bLazy = new Blazy({ success: function (ele) { // Image has loaded // Do your business here console.log('yes', ele); } , error: function (ele, msg) { if (msg === 'missing') { console.log('missing', ele); } else if (msg === 'invalid') { console.log('invalid', ele); } } });
I always use it now its not working NOW!! help
$(document).ready(function () { var bLazy = new Blazy({}); });
<img class="b-lazy" data-src="./imgs/home/banner_png.png" alt="">
note: no errors in the console, and I tried logging the
bLazy
object it logged in my console note: I tried Using this code didn't print anything in my console:var bLazy = new Blazy({ success: function (ele) { // Image has loaded // Do your business here console.log('yes', ele); } , error: function (ele, msg) { if (msg === 'missing') { console.log('missing', ele); } else if (msg === 'invalid') { console.log('invalid', ele); } } });