You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi your plugin is awesome. Question, we have so weird cases where the 'data-src' images won't load (we just see the 'src' placeholder).
First I tried to add the success / fail to see the magnitude of the occurrences (we track js errors):
success: function (ele) { console.log('loaded'); } , error: function (ele, msg) { if (msg === 'missing') { console.error('blazy missed loading image'); } else if (msg === 'invalid') { console.error('blazy encountered an invalid image'); } }
but found that the non loading images doesn't seem to trigger an actual error. So now I'm adding 'bLazy.revalidate();' in a hope to completely get rid of any issues. The full code now looks like this:
function bLazyInitiate() { var bLazy = new Blazy({ breakpoints: [{ width: 703 // max-width , src: 'data-src-small' }], success: function (ele) { console.log('loaded'); } , error: function (ele, msg) { if (msg === 'missing') { console.error('blazy missed loading image'); } else if (msg === 'invalid') { console.error('blazy encountered an invalid image'); } } }); bLazy.revalidate(); } //$(window).load(function () { // bLazyInitiate(); //}); $(function () { bLazyInitiate(); });
Do you think this is a good strategy and/or is the code solid?
The text was updated successfully, but these errors were encountered:
Hi your plugin is awesome. Question, we have so weird cases where the 'data-src' images won't load (we just see the 'src' placeholder).
First I tried to add the success / fail to see the magnitude of the occurrences (we track js errors):
success: function (ele) { console.log('loaded'); } , error: function (ele, msg) { if (msg === 'missing') { console.error('blazy missed loading image'); } else if (msg === 'invalid') { console.error('blazy encountered an invalid image'); } }
but found that the non loading images doesn't seem to trigger an actual error. So now I'm adding 'bLazy.revalidate();' in a hope to completely get rid of any issues. The full code now looks like this:
function bLazyInitiate() { var bLazy = new Blazy({ breakpoints: [{ width: 703 // max-width , src: 'data-src-small' }], success: function (ele) { console.log('loaded'); } , error: function (ele, msg) { if (msg === 'missing') { console.error('blazy missed loading image'); } else if (msg === 'invalid') { console.error('blazy encountered an invalid image'); } } }); bLazy.revalidate(); } //$(window).load(function () { // bLazyInitiate(); //}); $(function () { bLazyInitiate(); });
Do you think this is a good strategy and/or is the code solid?
The text was updated successfully, but these errors were encountered: