Reputation: 21
My carousel doesn't slide automatically. I can click through my pictures only. The strange thing is that at one point I could of sworn it did work. I just dont know what I could have changed since.
Here's my code:
<div class="row-fluid">
<div id="slider" class="span5" style="padding:15px;" >
<div class="carousel slide" style="border:#fff 3px solid;" id="treatments">
<div class="carousel-inner">
<div class="item active">
<img src="img/sliderpic1.jpg" alt="massage">
</div>
<div class="item">
<img src="img/sliderpic2.jpg" alt="pedicure">
</div>
<div class="item">
<img src="img/sliderpic3.jpg" alt="waxing">
</div>
</div>
</div>
<a href="#treatments" class="left carousel-control" data-slide="prev">‹</a>
<a href="#treatments" class="right carousel-control" data-slide="next">»</a>
</div>
<img src="img/logos.png" class="img-rounded">
</div>
Then just before the close body tag:
<script type="text/javascript">
$('.carousel').carousel({
interval: 1200
});
</script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.js"></script>
Thanks in advance for all of your help, it's much appreciated!
Upvotes: 1
Views: 1612
Reputation: 337714
You're setting up the carousel before you've included jQuery. Swap the <script>
tags around:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.js"></script>
<script type="text/javascript">
$('.carousel').carousel({
interval: 1200
});
</script>
Upvotes: 2