I have several pages with multiple collapsibles on them. When one is expanded, I want to close all the others. I have read that I need to use .trigger(‘expand’) and .trigger(‘collapse’) to dynamically open and shut… BUT HOW do I fire an event when a collapsible is actually opened?
I thought MAYBE the click event… $('#myExpandable').click() — no go.
I tried to bind .bind('expand', function() {} ); — no go…
And I tried .live('expand', function() {} ); .. all to no avail.
Can someone clue me in here?
Thanks!
You can bind to the element’s
expandevent, and then trigger acollapseevent on the rest of the collaspibles:Here is a demo: http://jsfiddle.net/FhZVn/