简体   繁体   English

Carousal-折叠div中的自动高度(GlideJS)

[英]Carousal - auto height in collapsed div (GlideJS)

I am using GlideJS to display a carousal. 我正在使用GlideJS来显示旋转木马。 The height of each item in this carousal is different and I have therefore set the property: 旋转木马中每个项目的高度都不同,因此我设置了属性:

autoheight: true

The problem is when I try to display the carousal in a collapsed div with the autoheight property set to 'true' the carousal is not displayed. 问题是,当我尝试在autoheight属性设置为'true'的折叠div中显示旋转木马时,不显示旋转木马。 When the autoheight property is set to false the carousal does display but then the height of the items is fixed. 当autoheight属性设置为false时,轮播会显示,但是项目的高度是固定的。 To illustrate this problem I have created the following Fiddle: 为了说明这个问题,我创建了以下小提琴:

https://jsfiddle.net/7dma7L84/21/ https://jsfiddle.net/7dma7L84/21/

How can I display the carousal in a collapsed div with auto height for each item? 如何在每个项目具有自动高度的折叠div中显示旋转木马?

I play a little with this and seems to solve problem with this: 我对此进行了一些尝试,似乎可以解决此问题:

#Carousel {
    width: 500px;
    height: auto;
}
var carousel = $('#Carousel').glide({
    type: 'carousel',
    startAt: 1,
    touchDistance: 2,
    autoplay: 0,
    autoheight: true
});

What do you think? 你怎么看?

这不是您想要的样子吗?

Check this picture and please confirm me if I understand correctly your desired 检查这张照片,如果我正确理解您的要求,请确认我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM