2
I’m implementing a function in my menu where it will close the content of dropdown
that is open IF the click is anywhere else except in the menu itself.
$(document).click(function(event) {
var $menuOpened = $('.dropdown-content');
$.each($menuOpened, function(index, value) {
if ($(value).hasClass('show') && event.target != $(value)) {
// Fecha o menu
}
});
});
Only always true
when I click anywhere else, even the button responsible for opening the dropdown
in question, so it is never displayed to be closed.
I have more than 1 dropdown that can be opened in the same menu.
I must have misunderstood, I’ve already withdrawn the answer
– Miguel