多项目轮播无显示

时间:2019-02-18 10:22:46

标签: bootstrap-4 carousel

我想寻求帮助,为什么我的轮播不显示任何项目。我的目标是一次至少显示3个项目。我已经尝试过增加身高,但无济于事。请注意,这里使用的图片来自Google,仅供采样。

这是我的代码https://jsfiddle.net/nm0f3twc/1的JS Fiddel

<div class="videosliderCarousel">
<div class="carousel slide multi-itemcarousel" id="videoSlider">
    <div class="carousel-inner">
        <div class="carousel-item active">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
        <div class="carousel-item">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
        <div class="carousel-item">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
        <div class="carousel-item">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
        <div class="carousel-item">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
        <div class="carousel-item">
            <div class="col-xs-4">
                <a href="" src="https://www.everythingcarers.org.au/media/1982/sample.jpg" class="img-rensponsive">
                </a>
            </div>
        </div>
    </div>
    <a class="left carousel-control" href="#theCarousel" data-slide="prev"><i class="glyphicon glyphicon-chevron-left"></i></a>
    <a class="right carousel-control" href="#theCarousel" data-slide="next"><i class="glyphicon glyphicon-chevron-right"></i></a>
</div>

1 个答案:

答案 0 :(得分:0)

我稍微改变了您的提琴,以表明该转盘确实起作用。因此,我在引导网站上为轮播添加了默认的html:

fiddle with basic carousel

正如我在评论中提到的那样,您的轮播无法正常工作,因为您使用的是<a>元素而不是<img>