I'm creating a responsive dropdown menu using the same html structure (without creating a structure larger than 1024 and one less than 1024), by clicking on the dropdown menu icon ul ul appears, but if I leave the open menu smaller than 1024 and increase the screen, the menu disappears (because of the jquery that uses display none to hide), I did the following routine in jquery:
window.onresize = function () {
if ($(window).width() > 1008) {
$(".nav ul").css("display", "block");
$(".nav").removeClass("menu_responsive");
$(".ico_menu_dropdown").removeClass("ico_menu_aberto");
}
else {
$(".nav ul").css("display", "none");
}
}
But when I enter the cell phone and give a scrol down (with the menu open) the menu hides. From what I understand jquery is understanding onresize as a scroll. Has anyone had the same problem?