Owl Carousel 2 - autoHeight (multiple items)

后端 未结 4 2011
粉色の甜心
粉色の甜心 2021-01-13 09:25

At the moment the Owl Carousel autoHeight works only with 1 item on screen. Their plan is to calculate all visible items and change height according to highest item.

<
4条回答
  •  花落未央
    2021-01-13 09:50

    I used flex to solve this issue:

     .owl-stage {
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
    
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    

    above code for owl-stage and below for owl-item class:

    .owl-item{
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        height: auto !important;
    }
    

    I hope this reply help every body that have this issue.

提交回复
热议问题