Javascript 에서 모바일 브라우저인지 감지하는 코드
static isMobile(){
// if we want a more complete list use this: http://detectmobilebrowsers.com/
// str.test() is more efficent than str.match()
// remember str.test is case sensitive
let isMobile = (/iphone|ipod|android|ie|blackberry|fennec/).test
(navigator.userAgent.toLowerCase());
return isMobile;
}
'프로그래밍 > JavaScript' 카테고리의 다른 글
WebPack 빌드 및 사용하기 (2) | 2018.08.21 |
---|---|
Three.js 에서 jd 모델 사용하기. (0) | 2018.08.08 |
스파인 애니메이션 재생 문제 (Spine Animation) (0) | 2018.07.13 |
Threejs repeat (0) | 2018.07.04 |
Spine Attachment Off (0) | 2018.06.20 |