centerMode not centering correctly
See original GitHub issueI’ve been having issues getting centerMode
to center the first slide on initialisation when using variableWidth
. I find that I have to move to the next slide, and back again for Slick to work out what the center actually is.
====================================================================
The provided jsfiddle required too much reworking to be relevant as this is a variable width example. I kept it as simple as possible though.
http://jsfiddle.net/1wyegw6L/16/
Interestingly in my real-world example the offset goes the other way, to the right. It actually looks like the first slide is just being offset by 50% with no correction for the slides width:
But once I’ve gone forward and then back a slide it corrects itself:
====================================================================
What is the expected behaviour?
Center the slideshow with a focus on the first slide.
====================================================================
What is observed behaviour?
The first slide is off-center on initialisation, but centers itself after navigation.
====================================================================
More Details
- Which browsers/versions does it happen on? Chrome 56.0.2924.87 (64-bit)
- Which jQuery/Slick version are you using? jQuery 3.1.1 Slick 1.6.0
- Did this work before? Before when?
Issue Analytics
- State:
- Created 7 years ago
- Comments:36 (1 by maintainers)
Top GitHub Comments
Two and a half years later, the bug still exists.
centerPadding to 0 fixes it.