I have a problem with jquery script if page size was changed. For example - if you open site on the phone, then open and close menu, then rotate phone from vertical to horizontal and open menu again - the block will not shown.
I use this script
return $(document).ready(function() {
(function($) {
if ($(window).width() < 960) {
$('#header-menu').css('display', 'none');
$('header.grid-container').css('display', 'none');
return $('#toggle-mobile-menu').click(function() {
$('#header-menu').toggle();
return $('header.grid-container').toggle();
});
}
})(jQuery);
});
I need some hook maybe, to reload script if screen was changed, without reload page. I tried to use $(window).resize() but it didn't work