i'm developing a drag-and-drop interface using jQuery-UI Draggable + jQuery-UI Sortable inside a jQuery-UI Tabs
here's the HTML code:
<div id="tabs">
<ul>
<li><a href="#tabs-1">One</a></li>
<li><a href="#tabs-2">Two</a></li>
<li><a href="#tabs-3">Three</a></li>
</ul>
<div id="tabs-1">
One
</div>
<div id="tabs-2">
Two
</div>
<div id="tabs-3">
<!-- BEGIN: DRAG & DROP INTERFACE -->
<div class="toolbar">
<div class="item">
<div class="in">
Satu
</div>
</div>
<div class="clear"></div>
</div>
<div class="sortable">
<div class="target">
<div class="clear"></div>
</div>
</div>
<!-- END: DRAG & DROP INTERFACE -->
</div>
And here's the javascript code:
jQuery(function() {
jQuery( "#tabs" ).tabs({ selected: 0 });
jQuery(".sortable .target").sortable({
opacity: 0.5
});
jQuery(".sortable .item, .toolbar .item").disableSelection();
jQuery(".toolbar .item").draggable({
connectToSortable: ".sortable .target",
helper: "clone",
revert: "invalid"
});
});
(you can see the whole code here: http://jsfiddle.net/dwiash/CWhFe/)
it works well if the drag-and-drop interface is placed inside a tab that initially shown. But it doesn't work if it placed in an initially inactive/hidden tab. The problem is, the drag-and-drop interface must be placed inside a tab that initially hidden/inactive
Can anyone help me fix this problem?
thx :)