/ Published in: JavaScript
Google Chrome 5.0.375.125 on Mac OS X 10.6 presents itself returns true for this function, even though its not really a touch device?
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isTouchDevice() { var el = document.createElement('div'); el.setAttribute('ontouchmove', 'return;'); if(typeof el.ontouchmove == "function"){ return true; }else { return false } }