Bootstrap accordion with open close icons

I’m trying to make it so that the accordion’s first panel is open and showing the minus sign by default. Here is a codepen
https://codepen.io/aaron4osu/pen/ZEQNaML?editors=1010

Any help would be greatly appreciated.

Hi @aaron4osu, just open it manually and compare the classes; then adjust your initial markup accordingly. Also see here in the docs, the example actually has the first panel open.

BTW the icon toggle in your codepen won’t work because of the <script> tags in the JS section – only include the actual JS there.

1 Like

I tried to manually add the class which opened it, but then when you closed it the minus sign showed up having the opposite effect of what was intended.

Did you also adjust the glyphicon class of the .more-less toggle to show the minus initially?

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.