jQuery UI Accordion in Accordion

前端 未结 2 1247
时光说笑
时光说笑 2021-02-20 12:58

Is it possible to have an accordion embedded in another accordion with jQuery UI?

-Item One
-Item Two
-Item Three
  --Sub One
  --Sub Two
  --Sub Three
-Item Fou         


        
相关标签:
2条回答
  • 2021-02-20 13:31

    Give each container that you want to make an accordion a class like accordion and use:

    $(".accordion").accordion();

    0 讨论(0)
  • 2021-02-20 13:37

    Just give different id names for each accordion and call them in the jquery function an you would have to edit the css to get the desired look though.

    $(function() {
        $( "#accordion,#accordion2" ).accordion();
      });
    

    DEMO

    0 讨论(0)
提交回复
热议问题