Problem with Carousel Bootstrap

1

I'm using a bootstrap carousel and the slides are not going by alone.

This is the error that appears:

  

Error: [$ compile: ctreq] Controller 'carousel', required by directive 'slide', can not be found!

Carousel

<div id="box-conteudo" class="clearfix">
  <div id="Box_cont_adj" class="clearfix">
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="2000">

      <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>


      <div class="carousel-inner" role="listbox">
        <div class="item active">
          <img src="Home/images/banner_1.png" width="965" height="280" alt="...">
          <div class="carousel-caption">
            ...
          </div>
        </div>
        <div class="item">
          <img src="Home/images/banner_2.png" width="965" height="280" alt="...">
          <div class="carousel-caption">
            ...
          </div>
        </div>
        <div class="item">
          <img src="Home/images/banner_3.png" width="965" height="280" alt="...">
          <div class="carousel-caption">
            ...
          </div>
        </div>


        <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>
    </div>
  </div>
  </div>
    
asked by anonymous 30.11.2015 / 04:08

1 answer

-1

There is a parameter for carousel that you must set to give it a autoplay , in this case interval :

$(function(){
    $('.carousel').carousel({
      interval: 2000
    });
});

If this is not enough, what should be, force the first switch:

$(function(){
    $('.carousel').carousel({
      interval: 2000
    });
    $('.carousel-control.right').trigger('click');
});
    
14.11.2016 / 11:17