Sunday, 15 May 2011

javascript - How to close all collapsible divs when modal is closed? -



javascript - How to close all collapsible divs when modal is closed? -

my problem simple after looking @ respective apis, don't know how accomplish following:

on webpage, have modal. modal contains accordion several collapsible div elements. when open modal, open collapsibles in accordion, close modal , open modal again, opened collapsibles still open. i'd rather want open collapsibles closed when modal gets closed. how do that?

or, simplify problem further, how can close open collapsibles in accordion @ once?

if using accordion-body class name accordion body sections per illustration link, , modal has id mymodal per other example, then:

$("#mymodal").on("hidden", function() { $("#mymodal .accordion-body").collapse("hide"); });

will collapse modal's accordion sections each time modal hidden.

javascript jquery html twitter-bootstrap

No comments:

Post a Comment