I'm using Jquery-Ui for Drag and drop elements . From the left box i would like to drag a hidden elements to the right box. The result is: When i'm dropping the elements, they are appear (display:block) with them parents.
The problem is that i can't define a draggable behavior to a hidden element (in my project -> .content elements). * i am also using the sortable widget for that operation.
Left box elements :
<ul class="side_bar">
<li class="side_bar_element">
<div class="preview">preview text</div>
<div class="content" style="display:none">The content that i want to copy</div>
</li>
<li class="side_bar_element">
<div class="preview">preview text</div>
<div class="content" style="display:none">The content that i want to copy</div>
</li>
</ul>
The right box container:
<div id="right-box" class="wrapper"><div>
And the Jquery:
$('document').ready(function () {
$(".wrapper").sortable({
opacity: .55});
$('.side_bar_element').draggable({
connectToSortable: ".wrapper",
cursor: "crosshair",
cursorAt: {left: -20, top: -20},
delay: 100,
grid: [10, 10],
helper: "clone",
opacity: 0.55,
zIndex: 100
});
});
How can i dragging just the .content elements, when they are displayed none ?