css - jQuery - only active menu item will change -


i'm beginner jquery , change background color active menu item , don't know how. if select item background change if select item, in item stay still "active background color" , want change default color , active menu item changed.

this static menu rebuilt dynamic menu database can use id or unique each menu item.

i have because , don't know how next:

        $('#accordian h3').click(function () {             $(this).addclass("active1")         }); 

complete source here http://jsfiddle.net/berrf/. answer in jsfiddle best. advance.

add:

$("#accordion h3").removeclass("active1"); 

you can see @ fiddle. don't need 2 click events, can combine them.

http://jsfiddle.net/sx2z7/

you have remove active1 classes every h3 before setting again, current active have white background colour.

it's clear or questions? :)


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -