Javascript full screen code and JS full screen code

Source: Internet
Author: User

Javascript full screen code and JS full screen code

// Judge various browsers and find the correct method function launchFullscreen (element) {if (element. requestFullscreen) {element. requestFullscreen ();} else if (element. required requestfullscreen) {element. required requestfullscreen ();} else if (element. webkitRequestFullscreen) {element. webkitRequestFullscreen ();} else if (element. msRequestFullscreen) {element. msRequestFullscreen ();}}

// Enable full screen! LaunchFullScreen(document.doc umentElement); // launchFullScreen (document. getElementById ("videoElement"); // a page Element

Exit full screen

// Determine the browser type function exitFullscreen () {if (document. exitFullscreen) {document. exitFullscreen ();} else if (document. mozCancelFullScreen) {document. canccancelfullscreen ();} else if (document. webkitExitFullscreen) {document. webkitExitFullscreen () ;}// exit full screen mode! ExitFullscreen ();

Method 2:

var opt='top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no';  window.open(youurl, "", opt); 



I really want to teach JavaScript code to make the current webpage full screen!

<! Doctype html> This is a relatively early full-screen code. Now there is pure full-screen API, but the browser compatibility is very poor. It only supports the latest versions of chrome and firefox, And none of others support it, so use this.

The above code has been fixed, and will automatically enter the full screen mode after opening. Of course, you must allow the page to automatically pop up the window.


How can I use js Code to implement full screen F11 on the keyboard? I 'd better try it and give the answer

<Html>
<Head>
<Title> test </title>
<Script language = "JavaScript">
Function Fkey (){
Var WsShell = new ActiveXObject ('wscript. shell ')
WsShell. SendKeys ('{F11 }');
}
</Script>
</Head>
<Body>
<A href = "javascript: Fkey ()"> screen switching </a>
</Body>
</Html>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.