Modify Twitter Bootstrap collapse plugin to keep accordions open

Actually, you don’t need to modify any code. Read the following statement closely from twitterbootstrap site

Just add data-toggle=”collapse” and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you’d like it to default open, add the additional class in.

So instead of using data-parent="#idofAccordion", use data-target="#idofCollapseItem".

It should work perfectly.

Here is the demo on plunker

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)