Alex Rivera | Logout

How can I make the Bootstrap js carousel automatically cycle as soon as the page loads?

Asked 2012-03-17T14:36:19.447
26

Using bootstrap.js version 2.02

I'm trying to get the Twitter Bootstrap Carousel to automatically cycle as soon as someone visits my site. Right now, the auto cycling works only after you click one of the cycle buttons at least once.

I want the carousel to begin cycling at the interval right away.

Does anyone know how to do this?

My site is hotairraccoon.com

You'll see how after you click the carousel once, it begins to cycle every 5 seconds or so, but I don't want the click to be required to reveal carousel content.

Thanks!

Edit
Report

2 Answers

9
$('.carousel').carousel({
  interval: 2000
})
answered 2012-03-17T14:52:11.007
4

The jquery.js file must load before the bootstrap.js, whether they are placed in the head tags or at the end of your file.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.js"type="text/javascript"></script>
answered 2012-11-03T04:54:02.083

Your Answer