Hello,
I want to have something similar to the sortable accordian in JQuery UI, that automatically sorts itself i.e. the active accordion panel (the open one - last one clicked) automatically moves to the top of the accordion.
Any ideas?
Here's the link to the JQ UI page: http://jqueryui.com/demos/accordion/#sortable
Thanks!
Here's the code I have (in reply to Thomas) :
$(function() {
var stop = false;
$("#ccaccordion h3").click(function( event ) {
if ( stop ) {
event.stopImmediatePropagation();
event.preventDefault();
stop = false;
}
});
$("#ccaccordion")
.accordion({
header: "> div > h3",
autoHeight: false,
"option",
"change",
function(event, ui){
ui.newHeader.parent().prependTo(this);
}
})
.sortable({
axis: "y",
handle: "h3",
stop: function() {
stop = true;
}
});
});