Path: csiph.com!aioe.org!.POSTED!not-for-mail From: emf Newsgroups: comp.lang.javascript Subject: Full screen button Date: Mon, 14 Mar 2016 21:13:39 -0400 Organization: Aioe.org NNTP Server Lines: 34 Message-ID: NNTP-Posting-Host: 7u0ZVf0uWUWx73oS+021lg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Mozilla-News-Host: news://news.aioe.org:119 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.javascript:29994 I need a button to turn the browser to full-screen mode to run some eye exercises: http://emf.neocities.org/ix/eyeExercises.html I've found some code on the web that does this for the current page, but returns to browser to normal screen when clicking on a link: function requestFullScreen() { var el = document.body; // Supports most browsers and their versions. var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; if (requestMethod) { // Native full screen. requestMethod.call(el); } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. var wscript = new ActiveXObject("WScript.Shell"); if (wscript !== null) { wscript.SendKeys("{F11}"); } } } How can I make it stay in full screen when you click on a link, like when you press F11? emf -- Natal Transits Calculator http://emf.neocities.org/nt/nataltransits.html