이 기사에서는 전체 화면 디스플레이 및 JS Control 페이지의 전체 화면 디스플레이를 설명합니다. 참조를 위해 공유하십시오. 특정 구현 방법은 다음과 같습니다.
다음과 같이 코드를 복사하십시오. <! doctype html>
<html>
<meta http-equiv = "content-type"content = "text /html; charset = utf-8" />
<body>
<div style = "마진 : 0 자동; 높이 : 600px; 너비 : 700px;">
<button id = "btn"> js 컨트롤 페이지 전체 화면 디스플레이 및 전체 화면 디스플레이 종료 </button>
<div id = "content"style = "margin : 0 자동; 높이 : 500px; 너비 : 700px; 배경 : #ccc;" >
<H1> JS 제어 페이지 전체 화면 디스플레이 및 전체 화면 디스플레이 종료 </h1>
</div>
</div>
</body>
<script language = "javaScript">
document.getElementById ( "btn"). onclick = function () {
var elem = document.getElementById ( "content");
requestfullscreen (elem);
};
함수 requestfullscreen (요소) {
var requestMethod = element.RequestFullScreen || 요소 .webKitRequestfullScreen || 요소 요소 .mmsrequestfullscreen;
if (requestMethod) {
requestMethod.call (요소);
} else if (typeof window.activexObject! == "undefined") {
var wscript = new ActiveXobject ( "wscript.shell");
if (wscript! == null) {
wscript.sendkeys ( "{f11}");
}
}
}
</스크립트>
</html>
이 기사가 모든 사람의 JavaScript 프로그래밍에 도움이되기를 바랍니다.