光滑的垂直滚动和覆盖

slick vertical scrolling and overlays

question, I'm wondering why does setting the scroll direction of the slider to vertical not scroll up and down properly? Could it be an issue with slick, or the CSS code that accompanies it? See http://codepen.io/anon/pen/VeELqN

开始

看起来,即使没有 CSS 代码,垂直滚动看起来也很糟糕,并且错误计算了下一张幻灯片的顶部 y 位置。

不太确定要在此处放置什么代码来克服这个烦人的提示,所以这就是 slick 对象的初始化方式:

$('#slider').slick({
    autoPlay:true,
    dots: true,
    arrows: true,
    vertical: true,
  }); 

您可以从浏览器的开发人员工具中观察到,某些 slick-slide 元素的高度已被插件计算错误,因为 slick 将该值设置为 'auto' 从而覆盖了您的规则。 您可以通过将 css 规则更改为以下内容来解决此问题:

.slick-slide {
    height: 200px !important;
}