I have a problem with jQuery sortable plugin. Indeed, I have items (questions) that use both the accordion and the sortable ones.
I am using the update sortable event to display additional content in each accordion of a question.
But my problem is that after sorting the questions, the accordion of the one I moved automatically opens.
Here is a simple example that reproduces the problem: http://jsfiddle.net/JwzH2/1/
Try sorting the questions and you will see the opening of the accordion yourself (sometimes this may not work correctly, so try again).
Does anyone have an idea how to fix it?
EDIT: Fosco gave me a partially working solution, but there is still a problem => it does not work with dynamically added elements (see my comments on his answer).
In addition, I am still surprised that the code works without this line: $('.hidden-content', question).show(); . In fact, the event propagation must be the same with and without this line
http://jsfiddle.net/JwzH2/38/
source
share