Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

images not loading #165

Open
mdalberto opened this issue Mar 14, 2018 · 1 comment
Open

images not loading #165

mdalberto opened this issue Mar 14, 2018 · 1 comment

Comments

@mdalberto
Copy link

mdalberto commented Mar 14, 2018

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?

@sinneren
Copy link

revalidate() not working for me. Not loaded images seems like magic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants