Slick: Responsive: Slides disappear on resize

Created on 21 Jan 2016  路  13Comments  路  Source: kenwheeler/slick

I'm facing the same problem with this issue: https://github.com/kenwheeler/slick/issues/1995 which is already closed.

Here's the fiddle: https://jsfiddle.net/wL1t5qu8/

Step:

  • Run the page on larger screen than breakpoint to see that there're 5 items and cannot autoplay because slidesToShow = 5. (correct)
  • Resize the page to lower than breakpoint (768) to see that it show 3 items with autoplay. (correct)
  • Wait for carousel to autoplay 1 item.
  • Resize the page back to original size.
  • The item showing is now 4 instead of 5 (bug)

Actually, if you wait for carousel to slide pass X items, when you resize back it's going to show 5 - X item. The only thing that's not reproduce this bug is when you wait carousel to slide pass exactly 5 items.

Confirmed

Most helpful comment

@simeydotme What is the status of this fix in current version 1.8.1. This fix is works fine in version 1.5.9. But not working in 1.8.1(latest)

All 13 comments

This isn't exactly elegant, but you can listen for the breakpoint/destroy events and do some resets as a work around.

Here's a codepen

Good bug report

@leggomuhgreggo Thanks! That should do the trick for now.

This is due to slidesToShow being <= slideCount ... when it hits this condition, it needs to be resetting back to slide position 1.

I just pushed a fix to master for this.
You can download that from the repo, or wait for a release :+1:
:bow:

@simeydotme Nice!

Oops, forgot to add the JSFiddle to show the fix;
http://jsfiddle.net/cz9ombo7/

@simeydotme Thanks guy!

Guys this issue isn't solved look at this

https://codepen.io/Onixia/pen/QrPaBP?editors=0110

If you remove responsive part everything will be work great.But i need 1 slide in small screens Please help :(

Here is the question is stackoverflow https://stackoverflow.com/questions/50485712/responsive-slides-disappear-on-resize

@simeydotme What is the status of this fix in current version 1.8.1. This fix is works fine in version 1.5.9. But not working in 1.8.1(latest)

I confirm this is still happening

This issue still occurs.

Oops, forgot to add the JSFiddle to show the fix;
http://jsfiddle.net/cz9ombo7/

Thanks @simeydotme! It works!!

Hey guys little late the party but here's the "bug" i'm having with "slider-nav" when resizing a couple of times. First slide gets bumped outside the viewport and sometimes the 2nd also. Any workaround? Thanks!

https://www.youtube.com/watch?v=OFXDv1Hy_Jc

$('.slider-nav').slick({ slidesToShow: 3, slidesToScroll: 1, asNavFor: '.slider-for', dots: false, centerMode: false, focusOnSelect: true });

Was this page helpful?
0 / 5 - 0 ratings