Bootstrap (twitter) accordion not working at all

I cannot for the life of me get bootstrap (or jquery-collapse for that sake) to work.

I have narrowed down the code to be pretty much the examples copied directly from the documentation, but still nothing:

The code: http://pastebin.com/kL0rWWw4

The result:

That is in chrome, without clicking. Clicking on anything does absolutely nothing :\

Any hints much appreciated.

Brgds, Stian

Upvotes: 2

Views: 2709

Answers (2)

FedeX
FedeX

Reputation: 446

Hi your problem it's that you are calling jquery library AFTER including bootstrap (which need it). To fix it, change order as follows:

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="../js/jquery-ui.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>

Upvotes: 1

Ryan Madsen
Ryan Madsen

Reputation: 1227

I'm guessing one of your js dependencies is not linked correctly. I copied your base html to a js fiddle and included the bootstrap dependencies & jquery, and everything worked as expected: http://jsfiddle.net/fzN4K/

Since bootstrap needs jquery, try including jquery.js before bootstrap.js. i.e. swap the lines:

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="../bootstrap/js/bootstrap.js"></script>

Upvotes: 3

Related Questions