Hello everybody,
I have the following HTML logical blocks :
So I would like to move my draggable elements in order to add them with the sortable accordions. It works fine, excepts that when my element is dropped among the sortable accordions, it cannot be opened.
$(function() {
$
( "> div", "#questionsDispos" ).draggable({
helper
: "clone",
revert
: "invalid",
cursor
: "move",
handle
: "h3",
connectToSortable
: ".questions"
});
$
( ".questions" ).accordion({
header
: "> div > h3",
collapsible
: true,
active
: false,
autoHeight
: false
}).sortable({
handle
: "h3",
receive
: function(event, ui) {
$
(ui.item).removeClass();
$
(ui.item).removeAttr("style");
}
});
$
( "#questionsDispos" ).accordion({
header
: "> div > h3",
collapsible
: true,
active
: false,
autoHeight
: false
});
});
<div class="questions">
<div>
<h3><a href="#">Question 1. My First Question ?</a></h3>
<div>
First content
<br />
</div>
</div>
<div>
<h3><a href="#">Question 2. My Second Question ?</a></h3>
<div>
Second content
<br />
</div>
</div>
<div>
<h3><a href="#">Question 3. My Third Question ?</a></h3>
<div>
Third content
<br />
</div>
</div>
</div>
Questions disponibles :
<br />
<div id="questionsDispos">
<div>
<h3><a href="#">Something</a></h3>
<div>
My Content Here
<br />
</div>
</div>
</div>
Does anyone have a solution ? Thanks