responsive - how to define media query with jQuery? -




i have buttons, , onclik scrolls content , code works :

jquery(document).ready(function(){      jquery("button#defaultopen").click(function() {        jquery('html, body').animate({             scrolltop: jquery("#defaultopen").offset().top+267         }, 1000);     });       jquery("button#spezialkurs").click(function() {        jquery('html, body').animate({             scrolltop: jquery("#spezialkurs").offset().top+267         }, 1000);     });      jquery("button#opengym").click(function() {        jquery('html, body').animate({             scrolltop: jquery("#opengym").offset().top+125         }, 1000);     });      jquery("button#challenge").click(function() {        jquery('html, body').animate({             scrolltop:jquery("#challenge").offset().top+125         }, 1000);     });      jquery("button#vielseitige").click(function() {       jquery('html, body').animate({             scrolltop: jquery("#vielseitige").offset().top-10         }, 1000);     });  }); 

the problem want add media query code run above 768 ! or more wrong here ?

thank you,

you can use this:

if (screen.width > 768) {your code goes here} 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -