I have a mobile navigation only running below 1025px. My problem is when a desktop browser is resized (or an orientation change on bigger tablets happend) from over 1024 to below it does not activate the script any more. I have tried with reload on resize, but this is not ideal because it reloads on every resize.
Here's my code:
<script>
$(window).bind('resize', function(e)
{
if (window.RT) clearTimeout(window.RT);
window.RT = setTimeout(function()
{
this.location.reload(false);
}, 100);
});
if (document.documentElement.clientWidth <= 1024) {
// Initialize mobile nav
}
</script>
Thanks!