Path: csiph.com!aioe.org!.POSTED!not-for-mail From: emf Newsgroups: comp.lang.javascript Subject: Re: Full screen button Date: Thu, 17 Mar 2016 03:58:23 -0400 Organization: Aioe.org NNTP Server Lines: 46 Message-ID: References: NNTP-Posting-Host: hscQtWRBHGXumnCJkhfShg.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-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.javascript:30030 On 2016-03-15 05:32, Stefan Weiss wrote: > On 03/15/2016 02:13, emf wrote: >> 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() { > [snip] >> How can I make it stay in full screen when you click on a link, like >> when you press F11? > > As far as I know, that's not possible, but you can use a workaround: > navigation inside an iframe will preserve the fullscreen mode, so you > could just load the whole thing in an iframe. > > Demo: http://foo.at/paste/2016/03-emf/ > > Note that the onclick attribute on the button has also changed. > > - stefan Thanks Stefan! Excellent solution. I only vaguely remember reading about iframe -- I did not consider it relevant to me at the time -- but now be sure I'll educate myself on the issue in the near future. The only problem now is the addition on top of the alert of the line: "The page at http://emf.neocities.org says:" (at least with Firefox). Is there a way to avoid this, or would you suggest an alternative? One possibility now, of course, would be to eliminate the alert entirely; a main reason I had included the alerts was that sometimes I would click on the link before entering full screen mode. Now this seems less of an issue... Eustace -- Spherical Triangle Calculator http://emf.neocities.org/tr/spherical.html