slick icon indicating copy to clipboard operation
slick copied to clipboard

Slick Carousel jumps on switch from last to first element and backwards

Open innergap opened this issue 8 years ago • 33 comments

We've created a carousel with slick and it's not performing smoothly for us. You can see the issue at: http://shudder.com. The top hero has a jump when you click the next button after the last element in the list.

Steps to reproduce the problem

  1. go to http://shudder.com
  2. click the hero till the end and again to the first slide

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

What is the expected behaviour?

No jump

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

What is observed behaviour?

jump

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

More Details

  • Which browsers/versions does it happen on? All
  • Which jQuery/Slick version are you using? Version: 1.6.0
  • Did this work before? Never

innergap avatar Jan 19 '17 17:01 innergap

@innergap I am facing the same issue on carousel. There is delay in adding class .slick-active from last slide to first slide of the carousel.

ankesh7 avatar Jan 20 '17 20:01 ankesh7

Having the same problem on carousel, anyone has a solution yet?

b0c avatar Mar 10 '17 11:03 b0c

Can confirm this is still happening. Last slide pops into view.

ghost avatar May 03 '17 10:05 ghost

any solution for this problem ?

ahmedash95 avatar May 13 '17 18:05 ahmedash95

Been looking for a fix for this for a while!

Kieraano avatar May 18 '17 23:05 Kieraano

+1

pete-willard avatar Jul 01 '17 18:07 pete-willard

For those looking for a solution, adding a CSS transition to your .slick-cloned state can help. Still an issue in the original code, but that can alleviate some issues.

nataliedeweerd avatar Aug 15 '17 15:08 nataliedeweerd

In slick version 1.5.9 this problem doesn't exist.

SventB avatar Sep 05 '17 11:09 SventB

Hi, I also have this problem. is there any css and js fix for now?

karamjeetsinghkst avatar Dec 13 '17 06:12 karamjeetsinghkst

Anyone figure out a fix? Running into same issue.

wutmikee avatar Dec 23 '17 21:12 wutmikee

You might want to take a look at 1537 issue.

zzap avatar Jan 24 '18 07:01 zzap

Why is #1537 related to this? This issue is still not fixed in newest version of slick.

SventB avatar Mar 26 '18 15:03 SventB

This issue still is not fixed, why?

It seems v1.6 works better for sliding from last to first slide, but it also have issue.

Is there any fix for v.1.9 ?

Codevz avatar Apr 21 '18 18:04 Codevz

the same problem https://codepen.io/bondardevelop/pen/ZjOEaZ

bondardevelop avatar Jul 18 '18 07:07 bondardevelop

https://github.com/kenwheeler/slick/issues/3419

Codevz avatar Jul 18 '18 07:07 Codevz

OMG, I tried everything, nothing help((

bondardevelop avatar Jul 18 '18 07:07 bondardevelop

Issue still occuring with version 1.9.0 I'm still using slick version 1.5.9 where this problem doesn't exist.

SventB avatar Oct 04 '18 10:10 SventB

I just encountered this issue now and had to brute force a fix. My current setup uses autoscroll and no arrows. after initializing my slick element, i added below.

$('.slick-class').on('afterChange', function(event, slick, currentSlide){ if(currentSlide == count){ $('.slick-class').slick('slickPause'); setTimeout(function(){ $('.slick-class').slick('slickGoTo',0); $('.slick-class').slick('slickPlay'); },autoplaySpeed); } });

izukingz avatar Oct 06 '18 12:10 izukingz

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

yokomele avatar Feb 10 '19 23:02 yokomele

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

This worked for me, thank you

djpeach avatar Feb 22 '19 14:02 djpeach

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

This worked. thank you

jamespotz avatar Jun 27 '19 00:06 jamespotz

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

Works! (drupal 8 slick module)

nimajnebp avatar Sep 18 '19 07:09 nimajnebp

Nothing works for me. Also checked https://github.com/kenwheeler/slick/issues/3419.

my initial slider options: slickOptions = { dots: false, arrows: false, speed: 1500, autoplay: true, infinite: true, autoplaySpeed: 0, cssEase: 'linear', slidesToShow: 1.2, slidesToScroll: 0.1, pauseOnHover: true, pauseOnFocus: false, lazyLoad: 'ondemand', responsive: [{ breakpoint: 600, settings: { autoplay: false, slidesToShow: 1, slidesToScroll: 1, centerMode: true, } }] } and on click: function stopAutoplay() { $(slider).slick('slickSetOption', { autoplay: false, infinite: true, cssEase: 'cubic-bezier(0.5,0,0,1)', slidesToShow: 1.5, slidesToScroll: 1, focusOnSelect: false, }, true); }; which cause jumping from last slide to first.

kozlowskam avatar Sep 19 '19 09:09 kozlowskam

Hi, kozlowskam. Have you tried this?

.slick-slider div { transition: none; }

Add this to the end of your style sheet. And your style sheet must be loaded after all other style sheets.

yokomele avatar Sep 19 '19 15:09 yokomele

Hello! yes I did. There is a white space instead of 1st slide after last one and it glitches when dragging.

kozlowskam avatar Sep 20 '19 07:09 kozlowskam

hello i have 3 slides in slider and i am showing 3 slides at same time on my page. i want when i click 3rd slide it move at position of 1st slide . is that possible i am showing all slides on my page.

samadiftikhar770 avatar Apr 17 '20 14:04 samadiftikhar770

I've tried adding the transition: none; with no luck. Is there another workaround for this?

smity81435 avatar May 05 '20 00:05 smity81435

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

Perfect helped a lot ! I have a little something extra to add That's may be obvious but if you got speed in the settings make sure that its on 0 speed: 0, =]

EzraElad avatar Jul 22 '20 06:07 EzraElad

I've been having the same problem on carousel, ButI finally could fix it by adding below to my style sheet.

.slick-slider div { transition: none; }

Worked !! Thanks alot man

akhzarjaved avatar Sep 15 '20 09:09 akhzarjaved

Hello! yes I did. There is a white space instead of 1st slide after last one and it glitches when dragging.

I had this and there seemed to be a blank slide added in, not sure how. Adding the 'slide' setting to ensure only the slides I intended were added fixed the issue.

woakley avatar Oct 14 '20 12:10 woakley