Answers for "check if on screen javascript"

3

javascript detect touch screen

function isTouchScreendevice() {
    return 'ontouchstart' in window || navigator.maxTouchPoints;      
};

if(isTouchScreendevice()){
    alert("I am a touch screen device")
}
Posted by: Guest on August-05-2019
0

if mousepressed javascript

var mouseDown = 0;
document.body.onmousedown = function() { 
  ++mouseDown;
}
document.body.onmouseup = function() {
  --mouseDown;
}
Posted by: Guest on March-23-2020

Code answers related to "check if on screen javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language