It's a simple question, but i don't know how do it. I think there's a way to close all of the sections in the accordion attached to a event click, but i haven't found a method that will allow it to be done. I tried this:
$(document).ready(initialize);
$("#accordion").accordion("destroy");
$("#accordion").accordion({
collapsible: true,
active: false
});
function initialize() {
$(".btnOk").click(function (e) {
e.preventDefault();
$("#accordion").accordion("active", false);
}
}
I think you're looking for the activate method instead of active method. I haven't tried it, but I think you should change:
$("#accordion").accordion("active", false);
to:
$("#accordion").accordion("activate", false);
Hope this helps.