Add a class "active" to menu item when clicked. Have it shut off when another menu item is clicked.
No matter what I try I cannot manage to get the li in my single page portfolio to switch/append the class "active" when I click it. I tried using a couple suggestions that I found in the forum but none of them seem to work. Can somebody help me out?? Here's the url to my portfolio:
http://alexseabrook.com/test.html
I thought that maybe this would work but no matter how many different ways I tried to implement it, it just didn't cooperate (I am a newbie):
- <script>
- $(document).ready($(function ()
- {
- $("li").click(function(){
- $("li").removeClass("off");
- $(this).addClass("active");
- });
-
- }));
- </script>
I just want to be able to make it so that when I click on, say, Development, it will highlight it by appending
- <li class="active">
or switching out
- <li class="off"> to <li class="active">
Thank you in advance for the help--
Alex