JQuery嵌套可排序手风琴

我正在为 JQuery使用 http://mjsarfatti.com/sandbox/nestedSortable/嵌套排序.我想让每个人都能成为手风琴.我已经达到了嵌套可排序和手风琴的程度;但是,每当我将任何可排序项拖到左侧时,整个应用程序就会冻结.

这是我的JS(运行正常):

$('ol.sortable').nestedSortable({
    disableNesting: 'no-nest',
    forcePlaceholderSize: true,
    handle: 'div',
    helper: 'clone',
    items: 'li',
    maxLevels: 10,
    opacity: .6,
    placeholder: 'placeholder',
    revert: 250,
    tabSize: 25,
    tolerance: 'pointer',
    toleranceElement: '> div'                   
});

$(function() {
    var stop = false;
    $( "#accordion h3" ).click(function( event ) {
         if ( stop ) {
            event.stopImmediatePropagation();
            event.preventDefault();
            stop = false;
            }
    });
    $( "#accordion" )
            .accordion({
            header: "> ol > li > div > h3"
    })
            .nestedSortable({
            axis: "y",
            handle: "h3",
            stop: function() {
            stop = true;
                    }
            });
    });

这是html:

<section id="accordion"> 
    <ol class="sortable"> 
        <li id="list_1">
            <div>
                <h3><a href="#">Header</a></h3>
                <div>
                    <p>des fields.</p>
                </div>
        </div>
        <li id="list_2"><div>Item 2</div> 
        <ol> 
            <li id="list_3"><div>Sub Item 2.1</div> 
            <li id="list_4"><div>Sub Item 2.2</div> 
            <li id="list_5"><div>Sub Item 2.3</div> 
            <li id="list_6"><div>Sub Item 2.4</div> 
        </ol>   
    </ol>
</section>

这绝对是一个问题,只有在将手风琴与sortables一起使用时才会出现.有人遇到过这个问题吗?

你可能想试试

$('ol.sortable').nestedSortable({ options }).accordion({accordion options});
相关文章
相关标签/搜索