JavaScript

[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 - getElementsByName() 메서드 ★ - 네임선택자
DOM_Document JS - getElementsByTagName() 메서드 ★ - 태그선택자 (= 요소선택자 = getElem…
DOM_Document JS - hasFocus() 메서드 ★ - 포커스 상태인지 체크 (= hasFocus메서드 = 해즈포커스메서…
DOM_Document JS - head 속성 - 헤드요소 (IE9 이상)
DOM_Document JS - images 속성 - 모든 이미지태그 모음 (= 이미지즈 컬렉션 = 이미지스 집합)
DOM_Document JS - implementation 속성 - DOMimplementation (돔구현객체)를 Document…
DOM_Document JS - importNode() 메서드 ★ - 다른문서의 노드복사해서 가져오기 (IE9 이상) ※ 아이프레임…
DOM_Document JS - inputEncoding 속성 - 입력인코딩문자셋 (= 입력인코딩언어셋) 반환 (IE9 이상)
DOM_Document JS - lastModified 속성 - 최종수정시간 (= 마지막수정시간) 반환 [읽기전용]
DOM_Document JS - links 속성 - href 속성 갖은 (앵커태그 + 에어리어태그) 링크태그집합
DOM_Document JS - normalize() 메서드 - 공백제거후, 인접텍스트노드 합치기 (document경우)
DOM_Document JS - normalizeDocument() 메서드 - normalize() 메소드와 유사 (지원 X)
DOM_Document JS - open() 메서드 - 출력모드 열기
DOM_Document JS - querySelector() 메서드 ★ - 쿼리선택자 (= 문서 안 지정 선택자 중 첫번째 것만 =…
DOM_Document JS - querySelectorAll() 메서드 ★★★ - 일치요소 모두 선택 (= querySelecto…
34/89
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인