Bootstrap carousel multiple frames at once

前端 未结 14 1062
清酒与你
清酒与你 2020-11-22 07:51

This is the effect I\'m trying to achieve with Bootstrap 3 carousel

\"enter

In

14条回答
  •  北海茫月
    2020-11-22 08:00

    I had the same problem and the solutions described here worked well. But I wanted to support window size (and layout) changes. The result is a small library that solves all the calculation. Check it out here: https://github.com/SocialbitGmbH/BootstrapCarouselPageMerger

    To make the script work, you have to add a new

    wrapper with the class .item-content directly into your .item
    . Example:

    
    

    Usage of this library:

    socialbitBootstrapCarouselPageMerger.run('div.carousel');
    

    To change the settings:

    socialbitBootstrapCarouselPageMerger.settings.spaceCalculationFactor = 0.82;
    

    Example:

    As you can see, the carousel gets updated to show more controls when you resize the window. Check out the watchWindowSizeTimeout setting to control the timeout for reacting to window size changes.

提交回复
热议问题