Detect Touch Screen

/** * Detect Touch Screen * @return {Bool} - Whether the device is touch screen */ const isTouchDevice = () => { return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); };

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.