views:

14

answers:

1

Hi,

I am using jquery accordion ui with sortable facility now that problem i am facing is when i drag the header of accordion and place it to the specified position then if the header is collapsed then it expands and if it is already expanded then it collapsed.

so i just want to keep the header closed whenever user drag it and then drop it.

my config property is as follow to create accordion

i have set collapsible true as i want a facility that if a user clicks then accordion header expands and clicks again then collapsed.

$("#accordion").accordion('destroy').accordion({ collapsible: true, active: true, 
autoHeight:    false, header: "> div > h3" }).sortable({
axis: "y",
handle: "h3",
stop: function(event, ui) {
 stop = true;
}
});
A: 

I Solved it on my own by adding following piece of code

var stop =false;

 $("#accordion h3").click(function(event) {
    if (stop) {
        event.stopImmediatePropagation();
        event.preventDefault();
        stop = false;
    }
});
Hunt