Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Get Bootstrap Carousel Basic Example Working

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

Any help greatly appreciated :-)

like image 402
richcollins Avatar asked Jul 29 '13 13:07

richcollins


2 Answers

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>
like image 56
David Taiaroa Avatar answered Sep 21 '22 07:09

David Taiaroa


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>
like image 31
cilerler Avatar answered Sep 20 '22 07:09

cilerler