And here's some additions to his function to make it a Toggle and not just an open.
function Togglepane(paneIndex, eventElement) {
var behavior = $get('<%=accReply.ClientID%>').AccordionBehavior;
var sel = behavior.get_SelectedIndex();
if (sel == paneIndex){paneIndex = -1};
behavior.set_SelectedIndex(paneIndex);
eventElement = eventElement == null ? window.event : eventElement;
eventElement.cancelBubble =true;
}
I also recommend you have a browse through the methods for the behaviour object. It's codearific!
No comments:
Post a Comment