Bootstrap 4 Multiple Items Carousel (several carousel items shown at once)

后端 未结 3 962
臣服心动
臣服心动 2020-12-08 08:14

How do you implement a multiple items carousel in Bootstrap 4? The docs mention about multiple carousels but not a carousel with multiple items.

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 08:45

    You can display one carousel item at a time, but fill it with multiple elements. Something like:

    .item
      .col-xs-4
         {content}
      .col-xs-4
         {content}
      .col-xs-4
         {content}
    

    But you may then be wishing you could advance them one at a time. That isn't going to happen with bootstrap right out of the box. After implementing many carousels, I'd recommend seeking another carousel library when Bootstrap's doesn't fit the bill. Slick.js is my go-to lib for lots of carousel config options. And its a fairly slim ~5k min'd and gzipped.

    If you're hard-set on using bootstrap, here is a script that can provide single advance, multi-items: http://codepen.io/MarkitDigital/pen/ZpEByz

提交回复
热议问题