Chrome에서 Js의 API 화면을 사용하고 싶습니다.screen.lockOrientation이 함수가 아닙니다.
if (navigator.userAgent.match(/(android|iphone)/gi)) {
if ('orientation' in screen) {
//console.log('// API supported, yeah!');
//console.log('new orientation is ', screen.orientation);
screen.lockOrientation('landscape');
} else {
console.log('// API not supported ');
}
} else {
//alert('none');
}
내 오류 JS : 잡힌 형식 오류 : screen.lockOrientation 함수
if (navigator.userAgent.match(/(android|iphone)/gi)) {
if ('orientation' in screen) {
let locOrientation = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;
locOrientation('landscape');
console.log('// API supported, yeah!' , locOrientation);
console.log('new orientation is ', screen.orientation);
//screen.lockOrientation('landscape');
} else {
console.log('// API not supported ');
}
} else {
//alert('none');
}
내 오류 JS
/* 다른 */
되지는 : locOrientation 함수 아니다업데이트 : 20/04/2017 -> 자바 스크립트를 사용하면 탐색기에서 방향을 고정 할 수 없습니다.
은 일반 페이지 또는 앱의 경우입니까? – dandavis
간단한 웹 페이지, 내 설정 : (webpack, vuejs) – Seb
페이지가 아닙니다 ... – dandavis