2016-09-11 2 views
0
<div class="row" style="padding-below:20px"> 
       <div class="col-md-12"> 
        <div class="carousel slide" id="carousel" data-ride="carousel"> 
         <ol class="carousel-indicators"> 
          <li data-target="#carousel" data-slide-to="0" class="active"></li> 
          <li data-target="#carousel" data-slide-to="1"></li> 
          <li data-target="#carousel" data-slide-to="2"></li> 
         </ol> 
         <div class="carousel-inner" role="listbox"> 
          <div class="item active"> 
           <img src="#"> 
           <div class="carousel-caption"> 
            <h2 class="media-heading"> 
             Workshop/event name 
            </h2> 
            <p>Description in a few lines and click on more to see details of the workshop. Or maybe not keep the more button only.</p> 
            <p><a href="#"><button class="btn btn-info">More &raquo;</button></a></p> 
           </div> 
          </div> 
          <div class="item"> 
           <img src="#"> 
           <div class="carousel-caption"> 
            <h2 class="media-heading"> 
             Workshop/event name 
            </h2> 
            <p>Description in a few lines and click on more to see details of the workshop. Or maybe not keep the more button only.</p> 
            <p><a href="#"><button class="btn btn-info">More &raquo;</button></a></p> 
           </div> 
          </div> 
          <div class="item"> 
           <img src="#"> 
           <div class="carousel-caption"> 
            <h2 class="media-heading"> 
             Workshop/event name 
            </h2> 
            <p>Description in a few lines and click on more to see details of the workshop. Or maybe not keep the more button only.</p> 
            <p><a href="#"><button class="btn btn-info">More &raquo;</button></a></p> 
           </div> 
          </div> 
         </div> 
         <a class="left carousel-control" href="#carousel" role="button" data-slide="prev"> 
         <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>Previous 
         </a> 
         <a class="right carousel-control" href="#carousel" role="button" data-slide="next"> 
         <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>Next 
         </a> 
         <div class="btn-group" id="cbuttons"> 
          <button class="btn btn-danger btn-xs" id="cpause"><span class="glyphicon glyphicon-pause"></span></button> 
          <button class="btn btn-danger btn-xs" id="cplay"><span class="glyphicon glyphicon-play"></span></button> 
         </div> 
        </div> 
       </div> 
      </div> 

私はカルーセルを作っています。ただし、クリック可能で前のカルーセルアイテムに移動する必要がある「前の」グリフコンの矢印は機能しません。それはまったく表示されません。私のコードはどこが間違っていますか?次のカルーセルアイテムにピントを付けるために使用されるボタンとグリフコンの矢印は正常に機能していますが、 'Previous'のものは表示されません。前回のカルーセルアイテムが動作しないためのボタン

答えて

0
Try this below code. 
<!-- Carousel 
================================================== --> 
<div id="myCarousel" class="carousel slide" data-ride="carousel"> 
    <!-- Indicators --> 
    <ol class="carousel-indicators"> 
    <li data-target="#myCarousel" data-slide-to="0" class=""></li> 
    <li data-target="#myCarousel" data-slide-to="1" class="active"></li> 
    <li data-target="#myCarousel" data-slide-to="2" class=""></li> 
    </ol> 
    <div class="carousel-inner" role="listbox"> 
    <div class="item"> 
     <img class="first-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="First slide"> 
     <div class="container"> 
     <div class="carousel-caption"> 
      <h1>Example headline.</h1> 
      <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p> 
      <p><a class="btn btn-lg btn-primary" href="http://getbootstrap.com/examples/carousel/#" role="button">Sign up today</a></p> 
     </div> 
     </div> 
    </div> 
    <div class="item active"> 
     <img class="second-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Second slide"> 
     <div class="container"> 
     <div class="carousel-caption"> 
      <h1>Another example headline.</h1> 
      <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> 
      <p><a class="btn btn-lg btn-primary" href="http://getbootstrap.com/examples/carousel/#" role="button">Learn more</a></p> 
     </div> 
     </div> 
    </div> 
    <div class="item"> 
     <img class="third-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Third slide"> 
     <div class="container"> 
     <div class="carousel-caption"> 
      <h1>One more for good measure.</h1> 
      <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> 
      <p><a class="btn btn-lg btn-primary" href="http://getbootstrap.com/examples/carousel/#" role="button">Browse gallery</a></p> 
     </div> 
     </div> 
    </div> 
    </div> 
    <a class="left carousel-control" href="http://getbootstrap.com/examples/carousel/#myCarousel" role="button" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> 
    <span class="sr-only">Previous</span> 
    </a> 
    <a class="right carousel-control" href="http://getbootstrap.com/examples/carousel/#myCarousel" role="button" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
    <span class="sr-only">Next</span> 
    </a> 
</div><!-- /.carousel --> 
+0

コードをどこで変更したか教えてください。 –

+0

このセクションを変更する必要があります Previous Dhaarani

+0

「次へ」と「前へ」ボタンのコードはまったく同じですから、なぜ「次へ」矢印とボタンを表示するだけで、「前のもの」ではないのですか? –

関連する問題