jQuery add class to current li and remove prev li
I found this jQuery add class to current li and remove prev li when click
inside li a, but it doesn't work for me. The situation is that the code
<ul>
<li class="current"><a href="#">menu item</a></li>
<li><a href="#aba">menu item</a></li>
<li><a href="#abb">menu item</a></li>
<li><a href="#abc">menu item</a></li>
<li><a href="#abd">menu item</a></li>
</ul>
is in a header.jsp file. Other jsp pages include this header.jsp. After I
added the jQuery as the link said, the class is added temporarily, and
then it is like refreshed and the page goes back to its initial state
which is the first li has the class current. Any idea?
No comments:
Post a Comment