UPDATE: Customize JQueryUI Accordion Click

The widget event handling code has changed with the latest JQueryUI code…  Back in April I posted how I hacked the JQueryUI accordion control to restrict the click to the arrow icon.  To get this hack to work with JQueryUI 1.9.1+ the code changes to:


$(document).ready(function() {

$(“#accordion”).accordion({
active: false,
collapsible: true,
event: “”
});

$(“.ui-accordion-header .ui-icon”).bind(“click.accordion”, function(evt) {
var current = $(this.parentNode.parentNode).data(“accordion”);
console.log(current);
evt.currentTarget = this.parentNode;
current._eventHandler( evt )
});
});

Advertisements