Using OC v1.5.6.4 I wish to keep css state for header menu as Clicked after clicked
I have this going as menu:
<div id="m">
<ul>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Store</a>
<div>
<ul>
<li><a href="#">Man</a></li>
<li><a href="#">Woman</a></li>
<li><a href="#">Accessories</a></li>
</ul>
</div>
</li>
</ul>
</div>
With css so:
#m > ul > li > a {
text-decoration: none;
}
#m > ul > li:hover > a {
color:#000 !important;
}
#m > ul > li > a.clicked {
color: #823428;
border-bottom: #823428 2px solid !important;;
}
#m > ul > li > div > ul > li > a {
text-decoration: none;
}
I have jQuery script:
$(document).ready(function() {
$("a").click(function(e) {
$("a", $("#menu")).each(function () {
if( $(this).hasClass("clicked") )
$(this).removeClass("clicked");
});
$(this).addClass("clicked");
});
});
When link is clicked before releasing mouse button it does turn to a.selected But after mouse click released it does not save class state.
What am I doing wrong?? Is it the page reloading?? Example: