I have an unordered list with a bunch of list items. I am setting the background of the selected <li> in its click:
$(this).animate({
backgroundColor: '#0000FF'
}, 'fast');
When I click another <li>, I want to change its backgroundColor property, but I want the rest of the <li>s to default back to another color. This way, it looks like I am changing the selected state.
You could simply do the following:
Example on jsfiddle