如何在jQuery选项卡中使用jQuery Nestable插件?

时间:2015-09-11 10:26:53

标签: javascript jquery jquery-plugins tabs

我使用 jQuery nestable jQuery标签创建菜单编辑器,我会将每个标签内的earch菜单项保存在下面

  1. #tab_a for English
  2. #tab_b 代表高棉语
  3. #tab_c for Chinese
  4. 这是html中的标签

    <ul class="nav nav-tabs">
       <li class="active"><a href="#tab_a" data-toggle="tab"> English </a></li>
       <li><a href="#tab_b" data-toggle="tab"> Khmer </a></li>
       <li><a href="#tab_c" data-toggle="tab"> Chinese </a></li>
    </ul>
    

    按各种语言标记内容

    <div class="tab-content">
    
      <!--tabs_a for English Languages-->
     <div class="tab-pane" id="tab_a">
      <input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>"/>  
      <div class='dd' id='product_lista'>
       <ol class="dd-list">
         <li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
       </ol>
      </div>
     </div> 
    
      <!--tabs_b for Khmer Languages-->
     <div class="tab-pane" id="tab_b">
      <input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>" />  
      <div class='dd' id='product_listb'>
       <ol class="dd-list">
         <li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
       </ol>
      </div>
     </div> 
    
      <!--tabs_b for Chinese Languages-->
     <div class="tab-pane" id="tab_b">
      <input type="text" id="entity_type" name="entity" value="<?php echo $entity;?>"/>
      <div class='dd' id='product_listc'>
       <ol class="dd-list">
         <li class="dd-item dd-collapsed" data-id="11"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="12"><div class="dd-handle">something</div></li>
         <li class="dd-item dd-collapsed" data-id="13"><div class="dd-handle">something</div></li>
       </ol>
      </div>
     </div> 
    </div> 
    

    这是 jquery可嵌套插件

    $("#product_lista, #product_listb, #product_listc").nestable({
        maxDepth: 10,
        collapsedClass: 'dd-collapsed',
    }).nestable('collapseAll');
    

    结果如下图所示

    它也适用于 Tabs_a ,但不适用于其他标签

    enter image description here

    不适用于 Tabs_b Tabs_c

    enter image description here enter image description here

    请帮忙

0 个答案:

没有答案