如何在bootstrap中使用左右箭头按钮创建图像滑块

时间:2017-11-15 04:16:47

标签: javascript jquery html css twitter-bootstrap

我需要创建图像滑块以使用箭头按钮左右移动。请在此处查看我现有的图片

<div class="col-md-3  animated fadeInUp" >
          <div class="tourbox">
            <div style="background-image:url(); width:100%; height:100%;" class="zoom" >
            </div>
            </div>
                <div class="col-md-12 text-center tourboxInner1"><img src="img/icons/info.png" width="30px"></div>
                <div class="col-md-12 text-center tourboxInner">CLASSICAL TOUR</div>

            </div>


            <div class="col-md-3 animated fadeInUp">
            <div class="tourbox">
            <div style="background-image:url(); width:100%; height:100%;" class="zoom" >
            </div>
            </div>
                <div class="col-md-12 text-center tourboxInner1"><img src="img/icons/info.png" width="30px"></div>
                <div class="col-md-12 text-center tourboxInner">TEA COUNTRY TOUR</div>
                </div>

my image slider example link here

我需要一次在页面中显示四个图像,并且需要使用新图像逐个左右移动。我在这里使用bootstrap。我怎么能这样帮助我?

2 个答案:

答案 0 :(得分:0)

嘿你好兄弟可能是我的回答帮助你完全使用bootstrap没有自定义css和js

<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
  <img class="d-block img-fluid" src="http://www.planwallpaper.com/static/images/desktop-year-of-the-tiger-images-wallpaper.jpg" alt="First slide">
</div>
<div class="carousel-item">
  <img class="d-block img-fluid" src="http://www.gettyimages.com/gi-resources/images/Embed/new/embed2.jpg" alt="Second slide">
</div>
<div class="carousel-item">
  <img class="d-block img-fluid" src="https://www.w3schools.com/w3css/img_fjords.jpg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

此处正在运作fiddle

答案 1 :(得分:0)

根据我的理解,您正在寻找滑块,每张幻灯片上显示4张图片。Try this using bootstrap。本教程可以帮助您carousel