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

Inconsistent behaviour when using asNavFor, with few slides. #1027

Closed
LarsDol opened this issue Feb 13, 2015 · 12 comments
Closed

Inconsistent behaviour when using asNavFor, with few slides. #1027

LarsDol opened this issue Feb 13, 2015 · 12 comments

Comments

@LarsDol
Copy link

LarsDol commented Feb 13, 2015

Hello! I'm experiencing some problems when using the asNavFor property.

I'm trying to use two sliders, first of which serves as the content, second as the navigation for the content that's available. The content slider shows only 1 item, while the navigation can show 3 thumbnails. Everything works perfectly fine when the sliders have more than 3 items to show. The navigation properly scrolls infinitely, and places .slick-active & .slick-center classes as expected.

The problem arises when there's less or equal slides than the slidesToShow. So in this case, there's 1, 2 or 3 slides. The navigation slider won't properly function. It (to me) randomly appoints .slick-center classes and doesn't set a .slick-active slide at initialisation. It almost looks as if the slider doesn't do anything at all. Problem is that it does respond to focusOnSelect events, so that's weird.

I've created some fiddles:

  • Less than 3 slides: http://jsfiddle.net/LarsDol/7nwzckua/ & http://jsfiddle.net/LarsDol/g776nz2x/ - These ones show the (to me) broken behaviour. Please check out the difference when setting an initialSlide: the slider will somehow get pulled to the left, hiding some slides instead of remaining centered. Also, when there's less than 3 the slides won't center at all. Lastly, the navigation won't respond to slick methods like $slider.slick('slickGoTo', 1);
  • This one works like a charm, with more than 3 slides: http://jsfiddle.net/LarsDol/gp5zhh36/1/ - To me, it seems like the .slick-active classes are given to each slide that fall within the 3 visible slides, and .slick-center to just the one in the center. Which is ok, but it seems like it's not that way in the first fiddle.

I've been messing with this for quite a while now. Really hope there's some kind of fix for this.

Thanks!

@befreestudios
Copy link

I believe this is related to an issue I brought up for the last version, which has not been fixed yet. I've notice the same behavior when using usNavFor and different numbers of slides and slidesToShow. When the total number of slides is not divisible by the slideToShow param, it fails...

See the thread here... #659

@inlikealion
Copy link

I'm experiencing this bug, too. Same scenario, where sometimes we have fewer slides in the nav slider than required, and it breaks, just as in @LarsDol first jsFiddle.

@inlikealion
Copy link

Now that it looks like @kenwheeler is back in the saddle, I wonder if he'll have a chance to look into this?

@samuMukkala
Copy link

I'm also experiencing this bug. Is there any advancement on this?

@Igloczek
Copy link

Igloczek commented May 5, 2015

Same here, looking for fix.

@kiprasbal
Copy link

Also have this problem, looking for a fix

@wKrawiec
Copy link

Not a problem at all when we have static page and know how many photos we will have there. Problem appears when we pass the editable website and don't exactly know the amount of slides client will insert there. Fix would be awesome!

@Olousouzian
Copy link

Same bug here... Looking for a fix

@anteksiler
Copy link

Same bug for me as well :) 👍

@ellye-s
Copy link

ellye-s commented May 30, 2016

Looking for a fix also

@kenwheeler
Copy link
Owner

Wouldn't it be easier to use the built in slick API to manually manage the two carousels, vs using asNav For?

@leggomuhgreggo
Copy link
Collaborator

Making #1189 the tracking issue for this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests