Widget:Carousel: Difference between revisions

From Jcastle.info
No edit summary
No edit summary
Line 1: Line 1:
<div class="container">
<div class="container">
  <h2>Carousel Options</h2>
<h2>Carousel Options</h2>
  <p>The <strong>data-wrap</strong> attribute specifies whether the carousel should go through all slides continuously, or stop at the last slide.</p>
<p>The <strong>data-wrap</strong> attribute specifies whether the carousel should go through all slides continuously, or stop at the last slide.</p>
  <p>In this example, we have set wrap to "false", which will stop the carousel from sliding when the last item is shown.</p>
<p>In this example, we have set wrap to "false", which will stop the carousel from sliding when the last item is shown.</p>
  <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="500" data-wrap="false">
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="500" data-wrap="false">
    <!-- Indicators -->
<!-- Indicators -->
    <ol class="carousel-indicators">
<ol class="carousel-indicators">
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
      <li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
      <li data-target="#myCarousel" data-slide-to="3"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
    </ol>
</ol>


    <!-- Wrapper for slides -->
<!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
<div class="carousel-inner" role="listbox">
      <div class="item active">
<div class="item active">
        <img src="himeji.jpg" alt="Chania" width="460" height="345">
<img src="himeji.jpg" alt="Chania" width="460" height="345">
      </div>
</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 class="item">
<!-- Left and right controls -->
        <img src="akashi.jpg" alt="Chania" width="460" height="345">
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="pre">
      </div>
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
   
<span class="sr-only">Previous</span>
      <div class="item">
</a>
        <img src="kinojo.jpg" alt="Flower" width="460" height="345">
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
      </div>
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
 
<span class="sr-only">Next</span>
      <div class="item">
</a>
        <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>
</div>

Revision as of 20:42, 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.