• 회원가입
  • 로그인
  • 구글아이디로 로그인

[ScreenOrientation] JS - ScreenOrientation 객체 - 장치 방향 정보 갖는 객체 (= 스크린오리엔테이션 객체)

목차

  1. ScreenOrientation 객체 정의
  2. ScreenOrientation 객체의 속성
  3. ScreenOrientation 객체의 메서드

 

ScreenOrientation 객체 정의

 

ScreenOrientation 인터페이스는 현재 문서가 포함된 화면 방향 정보 제공.

 

※ 3개의 속성(property: 값)과 2개의 메서드(method: 동작) 내장.

 

ScreenOrientation 객체의 속성

 

ScreenOrientation.type

읽기 전용. 장치 방향 표시. 아래 값 중 하나 반환.

  • "portrait-primary"
  • "portrait-secondary"
  • "landscape-primary"
  • "landscape-secondary"

 

ScreenOrientation.angle 속성

읽기 전용. 문서의 현재 방향 각도 반환.


ScreenOrientation.onchange 속성 ★★★

화면 방향 바뀔 때마다 호출되는 이벤트 핸들러.

 

 

ScreenOrientation 객체의 메서드

 

ScreenOrientation.lock() 메서드

포함하는 문서의 방향을 기본 방향으로 잠그고 Promise 반환. 


ScreenOrientation.unlock() 메서드

포함하는 문서의 방향을 기본 방향에서 잠금 해제.

 



분류 제목
게시물이 없습니다.
84/67
목록
찾아주셔서 감사합니다. Since 2012