9951 explained code solutions for 126 technologies


javascriptDetect mobile device


var mobile = window.matchMedia("only screen and (max-width: 760px)").matches;ctrl + c
mobile

will contain true if screen width is smaller than 760px (why is this better than user agent?)

window.matchMedia

check CSS defined rule for media