javascript - Continuity test if statment -


i have if statement looks this:

if ($(window).width() < 799) {     $('.element').css({'display': 'none'}); } else {      $('.element').css({'display': 'block'}); } 

i continuity test statement when window resized, go normal (or other way around). have tried setinterval not seem work nor seem right thing do. i'm aware can use css media queries of this, of code not show can not done in css.

$(window).on('resize', function() {     $('.element').toggle( $(this).width() < 799 ); }).trigger('resize'); // <- fires on pageload 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -