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

Lazy loading opacity problem #1354

Closed
hoyer-io opened this issue May 15, 2015 · 11 comments
Closed

Lazy loading opacity problem #1354

hoyer-io opened this issue May 15, 2015 · 11 comments
Assignees

Comments

@hoyer-io
Copy link

When you show more than one image e.g. by using "slidesToShow: 2" and also activate lazy loading "lazyLoad: 'ondemand'", then the inline opacity value of the first image is not adapted and stays 0. The image itself is loaded.

Example setting:

$('#xyz').slick({
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: false,
    lazyLoad: 'ondemand',
    responsive: [
        {
            breakpoint: 420,
        settings: {
        centerPadding: '40px',
        slidesToShow: 1
        }
     },
     {
        breakpoint: 1025,
        settings: {
        centerPadding: '40px',
        slidesToShow: 2
     }
    }
      ]
});```
@victorserpac
Copy link

Same Issue here

@simeydotme
Copy link
Collaborator

Might affect #1349 😥
@colorfool-me please could you read the contributing guidelines and provide a JS fiddle (from the guidelines file) to demonstrate this bug? 😃

Thanks, Si.

@hoyer-io
Copy link
Author

@simeydotme sorry, I didn't see that! My fault! And since I didn't mention it yet, slick is by far the best slider I found so far, great work!
I created a JS fiddle here:
https://jsfiddle.net/h1p4d3m5/9/
When you move back & forth some images stay just on opacity: 0 when having 2 slides shown at the same time. Thank you in advance. If you need more information, just let me know!

@simeydotme
Copy link
Collaborator

@colorfool-me , please check out this Fiddle... does it work OK for you?
I noticed that there seemed to be a race-condition for cloned-slides in the lazy-load function.

https://jsfiddle.net/simeydotme/h1p4d3m5/10/

@hoyer-io
Copy link
Author

@simeydotme Looks great!

@simeydotme
Copy link
Collaborator

Can you do me a favour and test it on all the browsers/devices you have available, and let me know the results? 😃

I will do the same, and if it works OK (I'll test a bunch of responsive options, too) I'll merge it in. 👍

@hoyer-io
Copy link
Author

I checked it on latest Safari, Chrome & Firefox on Mac

@hoyer-io
Copy link
Author

And latest Safari on iOS8. All looks fine!

@simeydotme
Copy link
Collaborator

OK, nice.
I checked on Windows:

  • Chrome
  • FF
  • Safari
  • IE 8-11

and Android

  • Chrome

All looks good. I'll get to merging :)

@hoyer-io
Copy link
Author

Great! Thanks for the quick fix! Keep up the great work!

simeydotme added a commit that referenced this issue May 18, 2015
Fixes #1354 - Race condition on Cloned Lazy Load
@simeydotme
Copy link
Collaborator

Applied on master, unminified file.
You'll have to wait for @kenwheeler to bump next version to get the minified files :)

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