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 sometimes don't load on 1.5.4 #85

Closed
ISB7 opened this issue Apr 26, 2016 · 15 comments
Closed

Images sometimes don't load on 1.5.4 #85

ISB7 opened this issue Apr 26, 2016 · 15 comments

Comments

@ISB7
Copy link

ISB7 commented Apr 26, 2016

Hello Support,

I use your beautiful script (js minify 1.5.4) and JS :

<script>var bLazy = new Blazy({selector:'img',container:'#frame1'});bLazy.revalidate();bLazy.destroy();</script>

But sometimes if you refresh the page http://www.insidebasket.com, images don't load... If you refresh again, it's ok. I don't know how to solve this.

Could you help me ?

Thanks you

@ISB7
Copy link
Author

ISB7 commented Apr 26, 2016

I think with revalidate function :

var bLazy = new Blazy({selector:'img',container:'#frame1'});setTimeout(function(){bLazy.revalidate();},300);

It's better...

@tuurbo
Copy link

tuurbo commented Apr 27, 2016

I'm getting the exact same issue, reloading page fixes it.

@dinbror
Copy link
Owner

dinbror commented Apr 27, 2016

Hey @tuurbo

Do you have a live example, jsfiddle or similar?

@tuurbo
Copy link

tuurbo commented Apr 27, 2016

@dinbror Looks like the image is being downloaded, because i can see it in the chrome tools network tab, but it isn't replacing the src attribute with the image url.

Theres a link inside to a live site with the issue http://pastebin.com/T9p6x21i

Edit: Sometimes it can take 10 to 20 different page loads to see the issue, and it can be all images or just 1 image.

@tuurbo
Copy link

tuurbo commented Apr 27, 2016

Did some tests on my local env and it seems the success callback isn't being fired for ever image, but the image is being downloaded.

Example:
5 images downloaded successfully, but only got 2 success callbacks.

new Blazy({
            selector: '.lazyload-img',
            successClass: 'lazyload-img-loaded',
            success: function(el){
                console.log('success', el);
                $(el).closest('.product-image').removeClass('img-loading');
            },
            error: function(el){
                console.log('error', el);
                $(el).closest('.product-image').removeClass('img-loading');
                $(el).attr('src', '/assets/img/no-product-image-medium.png').addClass('lazyload-img-loaded');
            }
        });

@tuurbo
Copy link

tuurbo commented Apr 27, 2016

@dinbror I think i found the issue... https://productforums.google.com/forum/#!topic/chrome/p51Lk7vnP2o

Would make sense, since i just started noticing the issue , yet i've been using v1.5.4 for a while..

@dinbror
Copy link
Owner

dinbror commented Apr 27, 2016

@tuurbo very interesting, thanks. However I can't reproduce it on your page. Are you on a mac or pc? What OS?

@tuurbo
Copy link

tuurbo commented Apr 27, 2016

Windows 10
Chrome 50.0.2661.87

@ISB7
Copy link
Author

ISB7 commented Apr 28, 2016

So, same problem with last version of Chrome 50.0.2661.86 (64-bit) on iMac (El Capitan).

Solved with : ;setTimeout(function(){bLazy.revalidate();},300);

@ISB7
Copy link
Author

ISB7 commented Apr 30, 2016

finally, not solved :(

@dinbror
Copy link
Owner

dinbror commented Apr 30, 2016

Hey @ISB7 and @tuurbo

Could you please test with version 1.6.1 RC:
http://dinbror.dk/blazy/versions/blazy-1.6.1.RC.js

@ISB7
Copy link
Author

ISB7 commented May 1, 2016

Hi dinbror,

I test it : http://www.insidebasket.com/blazy-test.php (you can check this URL)

At the first view, I think it works great, without setTimeout(function(){bLazy.revalidate();},300);. Could you confirm that ?

Is it possible to have a minify JS ?

Thanks you !

@dinbror
Copy link
Owner

dinbror commented May 2, 2016

Fixed in v.1.6.1

@dinbror dinbror closed this as completed May 2, 2016
@dinbror
Copy link
Owner

dinbror commented May 10, 2016

Fixed in chrome v 50.0.2661.94? Will verify later

@pedro412
Copy link

Hello mate sorry for troubling you but i may have found a bug related to this problem, when first loading the page or visiting for the first time also being cached by browser, it wont load the first images, reloading the page fixt it i dont know it may be a bug or my particular implementation
heres the link to the page im working on:

https://camprolabs.com/tutti/

Thanks in advance 👍

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

4 participants