views:

1359

answers:

2

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 loading up! Thanks a lot!

+1  A: 

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 accordian is a nested UL, the jQuery to hide all the nested UL elements would be like this:

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

Be sure to place this after the jQuery that sets up the accordian 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.

Beau Smith
thanks for you help, but Telerik Extensions has a little different, show that you can just use the hide function to hide the accordion
Kenneth Ho
+2  A: 

Try this:

It will disable all the active (open) pane.

$('.accordion').accordion({
    active: false,
    collapsible: true            
});
KienPham.com