How to change jQuery header background colors?

Experts

How to change the colors of the title of the accordion menu? what style class name is it? and how to set the selected tab by default?

See url: http://jqueryui.com/demos/accordion/

Here I need to select section 2 when I open the menu ...

Please help me to get the changes.

+8
jquery-ui
source share
3 answers

To change the background color of the title, in css, define the name of the accordion title class, and then change the background property as follows:

.ui-accordion-header{ background:black; } 

To set the active index to 2, use api: http://docs.jquery.com/UI/API/1.8/Accordion

Here you will find that you just need to call .accordion ("activate", index) on your jquery accordion object.

+14
source share

A quick inspection tells me you need to change the css declaration

 .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 tab, you can do something like below:

 $('#myAccordionId').accordion({}).accordion("activate" , indexOrSelector) //index in your case would be 1 
+2
source share

I have done this and it helps:

 #accordion h3{ background:none; background-color:yellow; } 

First, reset the primary color to set your favorite color.

+2
source share

All Articles