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

Slider jumping back to the beginning on infinite scroll #1914

Closed
tonemichael opened this issue Nov 24, 2015 · 7 comments
Closed

Slider jumping back to the beginning on infinite scroll #1914

tonemichael opened this issue Nov 24, 2015 · 7 comments

Comments

@tonemichael
Copy link

The slider is almost working great but for some reason when trying to use infinite, once it reaches the last slide then attempts the loop, it pauses for a second then visibly scrolls right back to the first slide?

This ever been reported before?

Thanks

$('.variable-width').slick({
dots: true,
centerPadding: '0px',
speed: 700,
slidesToShow: 1,
centerMode: true,
variableWidth: true,
infinite: true
});

@kenwheeler
Copy link
Owner

Closing due to not following CONTRIBUTING.md

@akeith2002
Copy link

I had this same issue and traced it back to my CSS applying a transition to body * which was overriding the .slick-track and .slick-list. I changed my call to body *:not(.slick-track):not(.slick-list){}

Hope that helps someone.

@SonnyCrockett
Copy link

adding to what @akeith2002 said, this issue cropped up for me because i had overriding styles on the .slick-track element in my stylesheet.

specifically it was the transition property i had placed on that element. once i got rid of it, Slick Slider stopped kicking back to the beginning when reaching the end of the set, and started looping as expected in an endless carousel of fun.

in order to make up for losing that transition in CSS, i added in some properties to the slider js, like so:

REMOVED from CSS
transition: left 0.5s cubic-bezier(0.770, 0.000, 0.175, 1.000);

ADDED to JS

speed: 500,
useTransform: true,
cssEase: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)',

@sumanengbd
Copy link

Thanks, @akeith2002 I was scratching my head for the whole day to fix it.

@BB-000
Copy link

BB-000 commented Sep 4, 2019

Hmm I also have this issue but definitely no overriding styles, check out this codepen (click from last slide to first slide dots), what's going on, it's not meant to be like this is it..?
https://codepen.io/bananafarma00/pen/PoYOmbP

@AntonGrekov
Copy link

have same problem , removed all transitions ... no help. gets even worse

@Prasanna-naik-97
Copy link

Prasanna-naik-97 commented Aug 4, 2023

specifically it was the transition property i had placed on that element. once i got rid of it, Slick Slider stopped kicking back to the beginning when reaching the end of the set, and started looping as expected in an endless carousel of fun.

Please let me know how you made this solution in order to stop kicking back to the beginning when reaching the end of the set.
In my case on .slick-track there is no transition property set but still it's kicking back to beginning.

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

8 participants