kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.54k stars 5.89k forks source link

Empty slides appended in between other slides (and not after last slide) in Chrome only #2735

Open abhiworld169 opened 7 years ago

abhiworld169 commented 7 years ago

Empty divs are created in between other slides and not after the last slide. This is happening in Chrome only and not on mozilla. In Mozilla, empty divs are created after the last slide to compensate space after the last slide.

Slide Count - 10 Slides to Scroll - 4

In Slick.prototype.buildOut function, we have a custom code which does this functionality

if((.slideCount % .options.slidesToScroll) !== 0 && .options.slidesToShow !== 1) { var placeholders = Math.abs(.options.slidesToScroll - (.slideCount % .options.slidesToScroll)); for(var i=0; i<placeholders; i++) { $('

').appendTo(.$slider).addClass('bwsTeaserContentMainDiv col-md-6 slick-slide placeholder'); } .$slides = $('.slick-slide:not(.slick-cloned)', .$slider); .slideCount = _.$slides.length; }

===================================================================IIt can be replicated at

https://agriculture.basf.com/jp/ja/%E8%BE%B2%E8%96%AC/%E6%B0%B4%E7%A8%B2.html

===================================================================

  • Which browsers/versions does it happen on? - Chrome only chrome mozilla
sg-mamedova commented 7 years ago

Do you use in your setings "infinite: true" ? it can help you