jquery - Dynamic javascript function -


this question has answer here:

i have javascript function want execute if browser screen bigger 1024px.

if ($(window).width() > 1024) { 

the problem code if user first load webpage in browser screen 800px , rescale browser screen 1024 (or more) function not executed. in order executed screen needs refreshed.

do have suggestion how fix it?

jquery resize

$(document).ready(function() {     if ($(window).width() > 1024) {         my_awesome_window_above1024_function();     } }); $(window).resize(function() {     if ($(window).width() > 1024) {         my_awesome_window_above1024_function();     } }); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -