Friday, March 22, 2013

Bootstrap collapse accordion not working on IE

I was struggling with this for sometime. Bootstrap's collapse accordion did not work on IE (7,8,9) but worked fine on Chrome. I am using Bootstrap version 2.3. People reported this issue for version 2.1 and there was a fix in the later version of Bootstrap. So, with v2.3 it should all be working. I tried a few things including pasting the code on jsfiddle and running it. It worked there. 
Finally I saw in my layout.cshtml (master page, if you may) that bootstrap.js and bootstrap.min.js, both have been included. I removed the .min script and boom, it started working. Why, what's up with bootstrap.min.js? I don't know. 


2 comments:

Tomas McGuinness said...

Both scripts contain the same thing, one is just compressed. You were confusing IE :)

Unknown said...

Tomas McGuinness is correct. If you include both the files browsers get confused.

bootstrap.min.js is compressed file of bootstrap.js.