I am currently utilizing the jQuery addClass and removeClass animate feature for my project.
Basically, what is happening is that when the user clicks on a particular link, a dropdown navigation will appear. This feature is essential for ensuring responsiveness of the site. So far, everything is functioning as it should. However, there is one issue that I am facing. When the link is clicked once, the class of the div changes along with the class of the link, which is working perfectly fine.
Now, here's where I need some help. Once the link is clicked for the second time, I want both classes to revert back to their default status.
Below is the code snippet that I am working with:
<div class="display-menu">
<div class="container">
<a id="displaymenu" class="click" style="color:#ffffff;" href="javascript:slideToggle();">In This Section</a>
<script>
$("a.click").click(function(){
$("div.display-menu").removeClass("display-menu").addClass("display-menu1");
$("a.click").removeClass("click").addClass("current");
});
</script>
</div>
</div>
Can anyone provide suggestions or ideas on how I can resolve this issue?