我将代码放在http://jsfiddle.net/yPQZx/394/
HTML
<div id="example5">
<ul>
<li>Start</li>
<li>TOC</li>
<li >section 1
<ul>
<li>chapter 1
<ul>
<li>sub chapter1</li>
<li>sub chapter2</li>
</ul>
</li>
<li >chapter 2<ul></ul></li>
<li >chapter 3<ul></ul></li>
</ul>
</li>
<li >section 2<ul></ul></li>
<li >section 3<ul></ul></li>
<li >section 4<ul></ul></li>
</ul>
的jQuery
$("#example5 ul").sortable({
connectWith: "#example5 ul li",
placeholder: "ui-state-highlight"
});
$("#example5 ul li ul ").sortable({
connectWith: "#example5 ul li ul",
placeholder: "ui-state-highlight"
});
CSS
ul { min-height:10px; }
li { width: 150px; }
任何人都可以帮我实现这个目标:
提前致谢。
答案 0 :(得分:1)
试试这个
$("#example5>ul>li>ul ").sortable({
connectWith: "#example5>ul>li>ul",
placeholder: "ui-state-highlight"
});
$("#example5>ul>li>ul>li>ul ").sortable({
connectWith: "#example5>ul>li>ul>li>ul",
placeholder: "ui-state-highlight"
});
$("#example5>ul>li").sortable({
connectWith: "#example5>ul>li",
placeholder: "ui-state-highlight"
});
$("#example5>ul").sortable({
connectWith: "#example5>ul",
placeholder: "ui-state-highlight"
});
希望这有帮助,谢谢