Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  101] [ 5]  / answers: 1 / hits: 56432  / 12 Years ago, wed, april 4, 2012, 12:00:00

I'm trying to modify the Bootstrap collapse plugin to allow me to specify whether clicking an accordion (to open) should automatically close the other items in the accordion (so more than one item in the accordion can be open at a time)



I want to create a new data attribute on the accordion, something like data-collapse-type=auto|manual



The bootstrap jQuery plugins are a bit advanced for my skill level. The most relevant part of what I need to mess with seems to be on line 52, actives.collapse('hide'). I don't want that to happen if 'data-collapse-type=manual' is set (omitting the attribute or setting auto should keep the default behavior).



I've created a jsfiddle where I've been experiementing.



Can anyone help get me on the right track with this?


More From » jquery

 Answers
25

I have forked and updated your fiddle.



just go to .show function, I have written also the comments.



http://jsfiddle.net/2Rnpz/


[#86414] Tuesday, April 3, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kadinl

Total Points: 321
Total Questions: 117
Total Answers: 103

Location: Nepal
Member since Mon, Jan 4, 2021
3 Years ago
;