Suppose I've the following html:
<ul>
<li class="activeitem"><a href="#">one</a></li>
<li><a href="#">two</a></li>
<li><a href="#">three</a></li>
<li><a href="#">four</a></li>
<li><a href="#">five</a></li>
</ul>
$('ul a').on('click',function(e){
e.preventDefault();
.....
Now, I want that if I click to five then it's parent's previous lists should be added with class activeitem
but in first there is already so from next of this add class to next li and remove the class after 400ms and then add class to next li and again remove class after 400ms and add class to next li. This process happens until the clicked menu li i.e. five and now finally I should get activeitem class to the cilcked link's parent li.