I'm having this problem I have in jquery that when window width is bigger than 800px remove this div:
if ($(window).width() > 800) {
$('.menu').remove();
}
But it doesn't happen instantly, you have to refresh site when window width is bigger than 800px. Btw. I have some CSS attached to .menu
. I heard something about event preventDefault()
, but it works with links or something like that. Can you help me please ?