Collapse all the tabs in a Accordion on jquery?

后端 未结 2 858
清歌不尽
清歌不尽 2020-12-08 03:11

By using the Telerik Extensions for ASP.NET MVC, how can I hide all the Accordion Tabs on page loading up ? By default, it will expand the first Accordion tab on page loadi

相关标签:
2条回答
  • 2020-12-08 03:52

    View the jQuery, there is most likely an option to specify the tab to show; by default this is probably the first. You can override the behavior by adding additional jQuery.

    If the accordion is a nested UL, the jQuery to hide all the nested UL elements would be like this:

    $('ul.accordion ul').hide();

    Be sure to place this after the jQuery that sets up the accordion functionality. Clicking any of the top LI should then show the nested UL.

    The markup may be different, but the logic should be very similar.

    0 讨论(0)
  • 2020-12-08 03:54

    Try this:

    It will disable all the active (open) pane.

    $('.accordion').accordion({
        active: false,
        collapsible: true            
    });
    
    0 讨论(0)
提交回复
热议问题