Reputation:
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!
Upvotes: 25
Views: 70023
Reputation: 34367
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.
Upvotes: 5
Reputation: 2779
Try this:
It will disable all the active (open) pane.
$('.accordion').accordion({
active: false,
collapsible: true
});
Upvotes: 101