Widget:Carousel: Difference between revisions

From Jcastle.info
No edit summary
No edit summary
Line 1: Line 1:
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="500">
<div class="container">
  <!-- Indicators -->
  <h2>Carousel Options</h2>
  <ol class="carousel-indicators">
  <p>The <strong>data-wrap</strong> attribute specifies whether the carousel should go through all slides continuously, or stop at the last slide.</p>
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  <p>In this example, we have set wrap to "false", which will stop the carousel from sliding when the last item is shown.</p>
    <li data-target="#myCarousel" data-slide-to="1"></li>
  <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="500" data-wrap="false">
    <li data-target="#myCarousel" data-slide-to="2"></li>
    <!-- Indicators -->
  </ol>
    <ol class="carousel-indicators">
  <!-- Wrapper for slides -->
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  <div class="carousel-inner">
      <li data-target="#myCarousel" data-slide-to="1"></li>
    <div class="item active">
      <li data-target="#myCarousel" data-slide-to="2"></li>
      [[File:himeji.jpg]]
      <li data-target="#myCarousel" data-slide-to="3"></li>
    </div>
    </ol>
     <div class="item">
 
      [[File:matsue.jpg]]
    <!-- Wrapper for slides -->
    </div>
    <div class="carousel-inner" role="listbox">
    <div class="item">
      <div class="item active">
      [[File:akashi.jpg]]
        <img src="himeji.jpg" alt="Chania" width="460" height="345">
      </div>
 
      <div class="item">
        <img src="akashi.jpg" alt="Chania" width="460" height="345">
      </div>
      
      <div class="item">
        <img src="kinojo.jpg" alt="Flower" width="460" height="345">
      </div>
 
      <div class="item">
        <img src="matsue.jpg" alt="Flower" width="460" height="345">
      </div>
     </div>
     </div>
    <!-- Left and right controls -->
    <a class="left carousel-control" href="#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="#myCarousel" role="button" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
      <span class="sr-only">Next</span>
    </a>
   </div>
   </div>
  <!-- Left and right controls -->
  <span class="left carousel-control" href="#myCarousel" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
    <span class="sr-only">Previous</span>
  </span>
  <span class="right carousel-control" href="#myCarousel" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
    <span class="sr-only">Next</span>
  </span>
</div>
</div>

Revision as of 20:39, 23 July 2017

Carousel Options

The data-wrap attribute specifies whether the carousel should go through all slides continuously, or stop at the last slide.

In this example, we have set wrap to "false", which will stop the carousel from sliding when the last item is shown.