user852610
user852610

Reputation: 2265

Moving slide in bootstrap

I am using the carousel of bootstrap, for this I have in my js folder all this file.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-typeahead.js"></script>

and my carousel is this.

   <div id="myCarousel" class="carousel slide">
        <!-- Carousel items -->
        <div class="carousel-inner">
            <div class="active item"><img src="img/cabecera/slide1.jpg"></div>
            <div class="item"><img src="img/cabecera/slide3.jpg"></div>
            ...
        </div>
        <!-- Carousel nav -->
        <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
        <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
    </div>

The problem is that the fist time the carousel don´t pass the slide, I have to press the left or right arrow to pass the slide , when I press the fist time the slide move alone.

What is wrong? I miss something.

Upvotes: 0

Views: 874

Answers (1)

Sir l33tname
Sir l33tname

Reputation: 4330

As I understand you it's the same question as here How can I make the Bootstrap js carousel automatically cycle as soon as the page loads?

According this the solution for your Problem is a bit js code:

$(document).ready(function () {
    $('.carousel').carousel({
        interval: 3000
    });

    $('.carousel').carousel('cycle');
});

Upvotes: 1

Related Questions