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

[DOM_Document] JS - fullscreenEnabled 속성 - 전체화면모드 (=풀스크린모드) 허용 (IE11 이상 접두어필요)

document.fullscreenEnabled 예제 

 

 

 

<meta name="viewport" content="width=device-width, initial-scale=1">


<button onclick="openFullscreen();">클릭</button>

<p><strong>Tip:</strong> "Esc" 키 누르면 풀스크린 모드 빠져나옴.</p>


<video width="100%" controls id="hzvideo">

  <source src="https://vt.tumblr.com/tumblr_o600t8hzf51qcbnq0_480.mp4" type="video/mp4">

  video tag 지원 않는 브라우저는 개나 줘버려.

</video>


<script>

var elem = document.getElementById("hzvideo");


function openFullscreen() {

  if (

    document.fullscreenEnabled || /* 표준 */

    document.webkitFullscreenEnabled || /* Chrome, Safari, Opera */

    document.mozFullScreenEnabled || /* Firefox */

    document.msFullscreenEnabled /* IE/Edge */

  ) {   

    elem.webkitRequestFullscreen();

    if (elem.requestFullscreen) {

      elem.requestFullscreen(); /* 표준 */

    } else if (elem.mozRequestFullScreen) { /* Firefox */

      elem.mozRequestFullScreen();

    } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari, Opera */

      elem.webkitRequestFullscreen();

    } else if (elem.msRequestFullscreen) { /* IE/Edge */

      elem.msRequestFullscreen();

    }    

  }

}

</script>

 

결과보기



분류 제목
DOM_Document JS - defaultView 속성 - 윈도우객체 (Window Object)
DOM_Document JS - designMode 속성 - 편집기능 활성화 (= 디자인모드)
DOM_Document JS - document.doctype 속성 -문서타입 (= DTD정보 = DocumentType 객체 반환…
DOM_Document JS - documentElement 속성 ★ - html요소 의미 (= 전체 웹문서 자체 = HTML 문서…
DOM_Document JS - documentMode 속성 - 문서로드IE버전 (IE전용)
DOM_Document JS - documentURI 속성 ★ - 현재웹문서위치 (= 웹문서주소)
DOM_Document JS - domain 속성 ★ - 현재웹문서의 도메인
DOM_Document JS - domConfig 속성 - 사용폐기. 돔구성
DOM_Document JS - embeds 속성 - 모든 엠베드태그 모음
DOM_Document JS - execCommand() 메서드 - 명령실행 (IE9 이상. 실험중) (예: 키보드이벤트때 실행)
DOM_Document JS - forms 속성 - 폼요소개수
DOM_Document JS - fullscreenElement 속성 - 전체화면요소 반환 (IE11 이상 접두어필요)
DOM_Document JS - fullscreenEnabled 속성 - 전체화면모드 (=풀스크린모드) 허용 (IE11 이상 접두어…
DOM_Document JS - getElementById() 메서드 ★★★ - 아이디선택자 (= 아이디로 요소얻기 = 아이디로 요…
DOM_Document JS - getElementsByClassName() 메서드 ★★ - 클래스선택자 (= 클래스명선택자 = 클…
DOM_Document JS - getElementsByName() 메서드 ★ - 네임선택자
DOM_Document JS - getElementsByTagName() 메서드 ★ - 태그선택자 (= 요소선택자 = getElem…
DOM_Document JS - hasFocus() 메서드 ★ - 포커스 상태인지 체크 (= hasFocus메서드 = 해즈포커스메서…
DOM_Document JS - head 속성 - 헤드요소 (IE9 이상)
DOM_Document JS - images 속성 - 모든 이미지태그 모음 (= 이미지즈 컬렉션 = 이미지스 집합)
25/67
목록
찾아주셔서 감사합니다. Since 2012