Reputation: 4053
I've got a problem with the bootstrap accordion.(http://twitter.github.io/bootstrap/javascript.html#collapse)
First, a jsfiddle showing the problem: http://jsfiddle.net/v6qPJ/7/
The collapsible group item works fine. Next, I've got a code which hide and show collapsible group item. It works too, but there is an issue if the user does this steps (all the code examples are from the jsfiddle, i've reduce the code to his minimum, so don't search any logic):
1) The active group item is hidden.
$(".accordion-group").first().hide();
2) A second group item (visible) is opened by the user.
3) The previously hidden group item is shown
$(".accordion-group").first().show();
4) The user can't open the first group item...
If the first group item is collapsed when we hide it, there is no problem. So I think that the problem come from how bootstrap manage the group for showing just one.
I found this similar issue: https://github.com/twitter/bootstrap/issues/6081 but the solution works for just a collapsible div, not the entire accordion...
I use the 2.3 version of Bootstrap.
Thanks.
Upvotes: 1
Views: 3562
Reputation: 4235
You need to use the bootstrap methods for the accordion to hide and show them.
The Bootstrap documentation says:
.collapse('show')
Shows a collapsible element.
.collapse('hide')
Hides a collapsible element
See fiddle here : http://jsfiddle.net/GUZgY/
Upvotes: 1