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

python 3.x - Mapping specific letters onto a list of words -

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -