问题
I have a very crude category list right now, but I'm wanting it to make it look and behave more like WordPress admin does it, where you can drag a category into another category.

Code looks like this:
<ul class="categories">
<li>Real Estate</li>
<li>Home Improvements</li>
<ul class="categories">
<li>Interior</li>
<li>Exterior</li>
<ul class="categories">
<li>Exterior Subcat</li>
</ul>
</ul>
</ul>
I tried jQuery UI's sortable, and told it to sort <li>
's only, but the list items wouldn't drag outside of their parent <ul>
list into another <ul>
list.
Any ideas how I can accomplish this?
回答1:
See: Sortable + nested lists with jQuery UI 1.8.2
And plugin: http://mjsarfatti.com/sandbox/nestedSortable/
来源:https://stackoverflow.com/questions/9728865/best-solution-for-drag-drop-category-subcategory-tried-jquery-ui-sortable-now