I'm currently working on animating a menu item where it expands to the left when hovered over, and contracts back when the mouse moves out. This part is functioning as expected.
Additionally, I am trying to apply a specific color to the button by adding a class on click, but for some reason it's not working.
Here's a fiddle link for reference: http://jsfiddle.net/g3ra912j/
CSS:
#menu1 .active {
background-color: #00f;
}
Script:
$("#menu1").click(function () {
$(this).toggleClass("active")
})
When clicked, it should turn blue, but it's not happening. Can someone point out what might be wrong?
Thank you!