I have the following div:
<div class="sub-menu">
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>
</div>
I have a function in jQuery
that shows and hides this menu when I click on div botão
, I have two conditions to hide this sub menu, or clicking div botão
or clicking on div sub-menu
itself using this function: / p>
$(".sub-menu").click(function(){
if(status == 1){
$('.sub-menu').animate({
left: '-224px',
}, 300);
$('.fade').fadeOut();
status = 0;
$('.hamburg').removeClass('open');
}
});
The status
variable checks whether sub-menu
is open or closed, the problem is that when I click on li's
within sub-menu
it ignores the link and just closes the sub-menu
div, how to do it readjust to the supposed pages when clicking the links?