jQuery UI Accordion in Accordion

↘锁芯ラ 提交于 2019-12-05 17:22:39

问题


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 Four

Where Sub One through Four is another accordion.

Thanks


回答1:


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

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




回答2:


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



来源:https://stackoverflow.com/questions/5723289/jquery-ui-accordion-in-accordion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!