8 lines
310 B
JavaScript
8 lines
310 B
JavaScript
window.addEventListener('touchstart', function onFirstTouch() {
|
|
// we could use a class
|
|
document.body.classList.add('touch-supported');
|
|
|
|
// we only need to know once that a human touched the screen, so we can stop listening now
|
|
window.removeEventListener('touchstart', onFirstTouch, false);
|
|
}, false);
|