k c
k c

Reputation: 211

handle bootstrap accordion before open pane changed event

My scenario has a wizard that uses an accordion for steps and I would like to do the right error handling at each step and also allow random panes to be opened without having to navigate through the wizard serially.

Does the Bootstrap accordion allow you to raise an event if the current open pane is changed? Also, can the event be blocked to handle errors and expose which pane is being closed and which is being opened?


Based on the answer I did the following and it worked.

$('#Accordion').on('hide.bs.collapse', function(ev) {
    if(ev.target.id == "review") {
        // do something
    }
});

Upvotes: 0

Views: 195

Answers (1)

alexmac
alexmac

Reputation: 19597

Bootstrap collapse contains these events, look here.

Upvotes: 1

Related Questions