2014-11-24 4 views

답변

4

navigator을 사용할 수 있습니까?

function is_touch_device() { 
return (('ontouchstart' in window) 
     || (navigator.MaxTouchPoints > 0) 
     || (navigator.msMaxTouchPoints > 0)); 
} 

if (is_touch_device()) { 
    alert("Yay! Its touch"); 
}else{ 
    alert("Not touch!") 
} 

전체 소스 : http://ctrlq.org/code/19616-detect-touch-screen-javascript

관련 문제