Javascript implementation control browser full screen _ javascript tips-js tutorial

Source: Internet
Author: User
This article mainly introduces the javascript code to control the full screen of the browser. It is very practical. If you need it, you can refer to it. The function is very simple, and the code is very concise. There is not much nonsense here.

function fullScreen() {  var el = document.documentElement,    rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen,    wscript;   if(typeof rfs != "undefined" && rfs) {    rfs.call(el);    return;  }   if(typeof window.ActiveXObject != "undefined") {    wscript = new ActiveXObject("WScript.Shell");    if(wscript) {      wscript.SendKeys("{F11}");    }  }} function exitFullScreen() {  var el = document,    cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.mozCancelFullScreen || el.exitFullScreen,    wscript;   if (typeof cfs != "undefined" && cfs) {   cfs.call(el);   return;  }   if (typeof window.ActiveXObject != "undefined") {    wscript = new ActiveXObject("WScript.Shell");    if (wscript != null) {      wscript.SendKeys("{F11}");    } }}

The above is all the content of this article. I hope you will like it.

Related Article

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.