Mike
Mike

Reputation: 6839

Twitter Bootstrap Carousel tackiness not rotating

I have a twitter Bootstrap carousel that I am trying to use within wordpress and it is stacking all the pictures on top of each other and doesn't rotate.

You can view it and see what I mean here.

My code looks like this:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://i0.wp.com/www.cattywampur.com/wp-content/uploads/2016/03/8566819595_0f567e8594_k.jpg" >
      <div class="carousel-caption">
        <h3>Traversing the Grand Canyon</h3>
      </div>
    </div>

  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://i2.wp.com/www.cattywampur.com/wp-content/uploads/2016/05/26300985983_713ab03dc1_k.jpg" >
      <div class="carousel-caption">
        <h3>San Jacinto - Deer Springs Trail</h3>
      </div>
    </div>



  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

Upvotes: 0

Views: 39

Answers (1)

AA2992
AA2992

Reputation: 1607

  • You only need one carousel-inner.
  • And one item set to active.

That way they don't stack and have the same wrapper.

<div class="carousel-inner" role="listbox">

  <div class="item active">
    <img src="http://i0.wp.com/www.cattywampur.com/wp-content/uploads/2016/03/8566819595_0f567e8594_k.jpg">
    <div class="carousel-caption">
      <h3>Traversing the Grand Canyon</h3>
    </div>
  </div>

  <div class="item">
    <img src="http://i2.wp.com/www.cattywampur.com/wp-content/uploads/2016/05/26300985983_713ab03dc1_k.jpg">
    <div class="carousel-caption">
      <h3>San Jacinto - Deer Springs Trail</h3>
    </div>
  </div>

</div>

Upvotes: 1

Related Questions