I have a javascript function which I want to execute only if the browser screen with is bigger than 1024px.
if ($(window).width() > 1024) {
The problem with this code is that if a user first load the webpage in a browser screen 800px and then just rescale the browser screen to 1024 (or more) the function is not executed. In order to be executed the screen needs to be refreshed.
Do you have any suggestion how to fix it?