adaptiveHeight animation makes lazy loaded slides 1px tall
See original GitHub issueI think the issue is that postSlide()
—a callback invoked from animateSlide()
which in turn calls animateHeight()
—runs after animateHeight()
;
but animateHeight()
should run after postSlide()
because it is from postSlide()
that setPosition()
gets called after lazy loading a new image (and it is here that the $list
’s height is set).
Notes: It doesn’t seem to happen on all browsers (confirmed on desktop Google Chrome 46.0.2490.86
), and where it does, it’s not every time.
The fix below (found here) doesn’t work reliably:
.slick-slide { height: auto; }
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Change height of Slick Carousel - css - Stack Overflow
I was having to set the height eg .slick-carousel{width: 200px;} because adaptive height wasnt working and slick was making the carousel as ...
Read more >Preventing Content Reflow From Lazy-Loaded Images
When a user scrolls and images are lazy-loaded, those img elements go from a height of 0 pixels to whatever they need to...
Read more >ThemeNectar | Changelogs - Salient
Fixed Salient Studio template library lazy loading to correctly work on all servers. Updated Salient Nectar Slider to v1.7.2.
Read more >Lazy Loading Images using Slick Slider - Solodev
Step 3 - Add the CSS below to a file called lazy-slide.css ; 1. /* Slider */ ; 2 .slick-slider { ; 3....
Read more >Slick Slider Accessibility Demo - CodePen
... height: 100%;\\n min-height: 1px;\\n}\\n[dir='rtl'] .slick-slide\\n{\\n float: ... slider.trigger('lazyLoaded', [_, image, imageSource]);\\n });\\n\\n } ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GordonDrop thanks, this put me on the right track. For newcomers, this code fixes the issue for me with 1.9.0 version (which uses events):
I’ve encountered same issue. It took me a while to deal with it. My workaround: