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

[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>

 

결과보기



분류 제목
Window_Console JS - console.timeEnd() 메서드 - 콘솔창에서 타이머 종료 후 기록 쓰기 (= console…
Window_Console JS - console.trace() 메서드 - 코드 실행 내역 역추적해 콘솔에 표시 (= console.t…
Window_Console JS - console.warn() 메서드 - 콘솔에 경고 쓰기 (= console.warn메서드 = 콘솔원…
DOM_Document JS - activeElement 속성 ★ - 현재포커스요소 반환 (= 액티브엘러먼트속성)
DOM_Document JS - addEventListener() 메서드 ★ - document에 이벤트 걸기. (= addEven…
DOM_Document JS - adoptNode() 메서드 ★ - 다른문서의 노드 잘라내서 가져오기 (IE9 이상) ※ 아이프레임…
DOM_Document JS - anchors 속성 - name 속성 갖은 모든 앵커태그집합 반환 (=anchors속성 = 앵커즈 …
DOM_Document JS - applets 속성 - 모든 애플릿태그집합 반환
DOM_Document JS - baseURI 속성 - 웹문서 기본URI 반환 (IE 지원X)
DOM_Document JS - body 속성 - 웹문서본문 설정/반환
DOM_Document JS - close() 메서드 - 웹문서출력모드 닫고 수집된 데이터 표시
DOM_Document JS - document.cookie 속성 ★ - (쿠키이름/쿠키값) 쌍을 설정/반환 (= document.…
DOM_Document JS - charset 속성 - 문자셋 (= 언어셋) 반환 (IE9 이상)
DOM_Document JS - characterSet 속성 - 문자셋 (= 언어셋) 반환 (IE9 이상)
DOM_Document JS - createAttribute() 메서드 ★ - 속성생성 (예: 클릭색상변경)
DOM_Document JS - createComment() 메서드 - 주석생성
DOM_Document JS - createDocumentFragment() 메서드 - 가상노드생성
DOM_Document JS - createElement() 메서드 ★ - 요소생성 (= createElement메서드 = 크리에이…
DOM_Document JS - createEvent() 메서드 - 이벤트객체생성 (예: 마우스오버횟수구하기)
DOM_Document JS - createTextNode() 메서드 - 텍스트노드생성
24/67
목록
찾아주셔서 감사합니다. Since 2012