Can't Get Bootstrap Carousel Basic Example Working

30,819

Solution 1

See it this helps: http://www.bootply.com/70201

It's using Bootstrap 3, with the HTML lifted directly from the carousel example on the Bootstrap docs and javascript

<script type="text/javascript" >
            $(document).ready(function() {        
        $('.carousel').carousel()
            });
</script>    

I also noticed that the source for your placeholder images is down for me at the moment so I'm using another URL for the slide images

Goold luck!

HTML

<div id="carousel-example-generic" class="carousel slide">
<!-- 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">
<div class="item active">
  <img src="http://placehold.it/900x500" alt="">
  <div class="carousel-caption">
    slide 1
  </div>
</div>
<div class="item">
  <img src="http://placehold.it/900x500" alt="">
  <div class="carousel-caption">
    slide 2
  </div>
</div>
<div class="item">
  <img src="http://placehold.it/900x500" alt="">
  <div class="carousel-caption">
    slide 3
  </div>
</div>
</div>

<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div>

Solution 2

You do not have holder.js included in your code please add the following line

<script type='text/javascript' src="http://imsky.github.io/holder/holder.js"></script>
Share:
30,819
richcollins
Author by

richcollins

Updated on July 11, 2020

Comments

  • richcollins
    richcollins almost 4 years

    This carousel looks pretty straightforward but I can't get it working

    Any help greatly appreciated :-)