Experts,
how to change the accordion menu header colors ? which style class name is this ? and how to set default selected tab ?
Please see the URL: http://jqueryui.com/demos/accordion/
Here i need to select section 2 when i am opening menu...
Please help me out to get changes.
You can use the class "background-green" to add background color green or "text-green" to add the text green.
The jQuery UI Accordion Widget can be used for the conversion of pairs of header & content panels into an accordion. The jQuery UI Accordion create event is used to trigger when the accordion is created. If an accordion widget is collapsed, then the ui. header and ui.
In order to change the background color of the header, in the css, identify the accordion header class name and then change the background property like so:
.ui-accordion-header{
background:black;
}
In order to set the active index to 2, use the api: http://docs.jquery.com/UI/API/1.8/Accordion
Here you will find that you just have to call .accordion( "activate" , index ) on your jquery accordion object.
A quick inspection tells me that you have to modify the css declaration of
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited
and
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited
As for the default selected tab you could do something like below:
$('#myAccordionId').accordion({}).accordion("activate" , indexOrSelector) //index in your case would be 1
I did this and it helps:
#accordion h3{
background:none;
background-color:yellow;
}
First reset the main color then set the favorite color.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With