Today I have an onclick on the id #menu
, whenever I click on #menu
it does a certain action, I need to create an action that everything other than #menu
does a certain action. How do I do that? Is there a: !ação
in javascript?
My code in JS is this:
$(document).ready(function() {
$("#head header .menu").on('click', function() {
if ($(this).hasClass('active')) {
$('#menus').css({
"top": "-120px"
});
$('#menus').css({
"left": "-50%"
});
$(this).removeClass('active')
} else {
$('#menus').css({
"top": "0"
});
$('#menus').css({
"left": "0"
});
$(this).addClass('active')
}
});
});
And the HTML:
<icon class="menu"></icon>
<ul>
<div id="menus">
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
<li><a href="#">LINK</a></li>
</ul>
</div>