javascript - Slick - slides jump with centerMode and variable width - Stack Overflow

I have a slick slider with centerMode true and variableWidth: true.The center slide needs to be 2x bi

I have a slick slider with centerMode true and variableWidth: true.

The center slide needs to be 2x bigger than the other slides.
All slides have a width of 80px but the center need to have 160px.

here's a fiddle and code of my problem (jsfiddle messed it up but you can see the "jump"):

$('#timeline').slick({
      centerMode: true,
      centerPadding: '60px',
      slidesToShow: 5,
      variableWidth: true,
      arrows:false
});

/

I'll post more code if needed. Any solutions to that?

I have a slick slider with centerMode true and variableWidth: true.

The center slide needs to be 2x bigger than the other slides.
All slides have a width of 80px but the center need to have 160px.

here's a fiddle and code of my problem (jsfiddle messed it up but you can see the "jump"):

$('#timeline').slick({
      centerMode: true,
      centerPadding: '60px',
      slidesToShow: 5,
      variableWidth: true,
      arrows:false
});

https://jsfiddle/xf365usn/15/

I'll post more code if needed. Any solutions to that?

Share Improve this question asked May 13, 2018 at 19:07 Marek123Marek123 1,2117 gold badges39 silver badges78 bronze badges 5
  • I see all the slides as circles with the same size. The problem is the size or the jump from the overlapping? – muecas Commented May 13, 2018 at 19:43
  • the circles have all 80 bersides the center one, this one should have 160...jsfiddle messed it up – Marek123 Commented May 13, 2018 at 19:49
  • And the jump is the jump the slides made when overlapping? – muecas Commented May 13, 2018 at 19:59
  • no... when you have different widths.... see the fiddle.. it jumps there... – Marek123 Commented May 13, 2018 at 20:54
  • 1 I think i need to change that fiddle. All the slides are the same size and overlapped. Ill try my best to help you. – muecas Commented May 13, 2018 at 21:18
Add a ment  | 

2 Answers 2

Reset to default 3

I resolved this issue with a fixed width on all slide with

.slick-slide { width:200px; }  

and variableWidth: true
I also left centerMode on true and edited the slick-active slide to get the desired results.

If you give the .slick-track some CSS animation transition it works well..slick-track { transition: all 0.3s ease; }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745241443a4618204.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信