Nuka Carousel heightMode在反应中不起作用 [英] Nuka Carousel heightMode don't work in react

查看:68
本文介绍了Nuka Carousel heightMode在反应中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 nuka旋转木马,其中有3张幻灯片,幻灯片的高度取决于内容的大小。因此,如果一张幻灯片有5行文本,而另一张幻灯片有6行文本,则该幻灯片将高于另一行。

I have a nuka carousel with 3 slides and the height of the slides depends on the size of the content. So if one slide has 5 rows of text and another has 6 rows of text the one will be higher than the other.

因此,要解决此问题,我发现了 heightMode 道具,将在最高的幻灯片之后设置幻灯片的高度,但是当我在本地测试时没做任何事情。

So to fix this I found a heightMode prop where the slides height will be set after the tallest slide but when I test locally it doesn't do anything.

有什么方法可以手动更改 slideHeight 吗?

Is there any way to change slideHeight manually?

有人知道 heightMode 道具是否正常工作吗?

Does anybody know if heightMode prop is working or not?

推荐答案

我也遇到了此问题,这是我的解决方法。我刚刚添加了一些CSS代码:

I also encountered this problem and here's my fix. I Just added some css code:

.slider-list {
    height: auto!important;
}

.slider-slide {
    position: sticky!important;
}

这篇关于Nuka Carousel heightMode在反应中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆