JavaScript

[DOM_Element] JS - exitFullscreen() 메서드 - 전체화면모드 닫기 (IE11 이상)

exitFullscreen() 예제

 

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


<h2>홈짱닷컴</h2>

<p>Homzzang.com</p>


<button onclick="openFullScreen();">전체화면모드 열기</button>

<button onclick="closeFullScreen();">전체화면모드 닫기</button>


<script>

var docu = document.documentElement;

function openFullScreen() {

  if (docu.requestFullscreen) {

    docu.requestFullscreen();

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

    docu.mozRequestFullScreen();

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

    docu.webkitRequestFullscreen();

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

    docu.msRequestFullscreen();

  }

}


function closeFullScreen() {

  if (document.exitFullscreen) {

    document.exitFullscreen();

  } else if (document.mozCancelFullScreen) {

    document.mozCancelFullScreen();

  } else if (document.webkitExitFullscreen) {

    document.webkitExitFullscreen();

  } else if (document.msExitFullscreen) {

    document.msExitFullscreen();

  }

}

</script>

 

결과보기

 


분류 제목
DOM_Element JS - childElementCount 속성 - 자식요소개수 (IE9 이상)
DOM_Element JS - childNodes 속성 - 자식노드리스트
DOM_Element JS - children 속성 ★ - 자식요소노드 (IE9 이상)
DOM_Element JS - classList 속성 ★★ - 요소의 클래스리스트. (= classList속성 = 클리스리스트속성…
DOM_Element JS - className 속성 ★★★ = 요소의 클래스명 반환/설정. (= className속성 = 클래스…
DOM_Element JS - click() 메서드 ★★★★★ - 마우스클릭간주 (= 클릭이벤트 = click메서드 = 클릭메서드…
DOM_Element JS - clientHeight 속성 - 요소높이 (= 요소가시높이) (padding 포함 / border,…
DOM_Element JS - clientLeft 속성 - 요소왼쪽테두리너비 (= 요소좌측테두리너비)
DOM_Element JS - clientTop 속성 - 요소위쪽테두리너비 (= 요소상단테두리너비)
DOM_Element JS - clientWidth 속성 ★ - 요소너비 (= 요소가시너비 = clientWidth속성 = 클라이…
DOM_Element JS - cloneNode() 메서드 - 노드복사
DOM_Element JS - compareDocumentPosition() 메서드 - 노드간 위치비교 (IE9 이상)
DOM_Element JS - contains() 메서드 ★ - 자손노드인지 판별 (= contains메서드 = 컨테인즈 메서드)
DOM_Element JS - contentEditable 속성 - 편집가능상태 설정/반환
DOM_Element JS - dir 속성 - 쓰기방향 (= 입력방향) 설정/반환
36/89
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인