jQuery可排序插件,用于无序列表多维 [英] Jquery sortable plugin for unordered list multi dimension

查看:64
本文介绍了jQuery可排序插件,用于无序列表多维的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的清单multi dimensiosn:

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>

当使用可排序的Jquery插件时,我只能拖放它们在同一'ul'标记中的元素,例如,如果我拖动"212"标记并将其放置在"213"标记之后,则该插件工作正常,但是如果我拖动"212"标签并将其放在"206"之后,则无法正常工作.

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 .

这是我的功能:

 $("#tree ul").sortable({ 

         opacity: 0.6, 
         cursor: 'move',
         containment : '#tree',
         grid : [10, 10]


         });

想寻求帮助.

推荐答案

您应该在jQueryUI中使用connectWith: .someClass功能.它在文档中.这是您更新的 jsfiddle示例 .

You should use connectWith: .someClass feature in jQueryUI. Its in the documentation. Here is your jsfiddle example updated.

这篇关于jQuery可排序插件,用于无序列表多维的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆