The problem is that the script is executed only after I change the size of the window (or zoom in / out) - how to make the script run immediately after the page is updated. It seems clearly explained.
$(window).resize(function(){ var windowWidth = $(window).width(); if(windowWidth < 1290) { console.log("windows size < 1290"); } else { } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>