jquery ui accordions within tabs

后端 未结 7 551
失恋的感觉
失恋的感觉 2020-12-05 10:17

I’ve run into a problem using accordions within tabs, the initially inactive accordions do not render their content correctly when their tab is selected. Reading around I s

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 10:49

    None of the above worked for me. For me, the trick was to change from using unique div IDs for each accordion to a single class identification for all accordions. That is, change:

    ,etc... to
    within each of the tabs.

    You may also need to add to your $(document).ready function

    $(".accordion").accordion({
          autoHeight: false
      });
    
      $('#tabs').tabs();
      $('#tabs').bind('tabshow', function(event, ui) {
          $(".accordion").accordion("resize");
          });
    

    So the format would be:

    
    
    
      
      
       
    
      
    
    
    

    Header 1

    Header 2

    Header 3

    <

    Header 4

    Header 5

    Header 6

    <

    Header 7

    Header 8

    Header 9

    <

提交回复
热议问题