问题
This is my list multi dimensiosn :
<div id="tree">
<ul>
<li id="205">205
<ul>
<li id="206">206
<ul>
<li id="208">208</li>
<li id="209">209</li>
<li id="211">211
<ul><li id="212">212</li>
<li id="213">213</li>
</ul>
</li>
</ul>
</li>
<li id="207">207
<ul>
<li id="210">210</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
When using Jquery plugin sortable , i can only drag and drop elements which they are in the same 'ul' tag , for exemple , if i drag the "212" tag and i dropped it after "213" tag , the plugin works fine , but if i drag "212" tag and i drop it after "206" , it did'nt work .
here is my function :
$("#tree ul").sortable({
opacity: 0.6,
cursor: 'move',
containment : '#tree',
grid : [10, 10]
});
thinks for help .
回答1:
You should use connectWith: .someClass
feature in jQueryUI. Its in the documentation. Here is your jsfiddle example updated.
来源:https://stackoverflow.com/questions/18315391/jquery-sortable-plugin-for-unordered-list-multi-dimension