Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Toggle full screen view

The respondent can toggle between the full screen view and a smaller window by hitting F11.  Is there code that will allow my program to do it in v8.4.8?
asked Feb 19, 2017 by Mike (245 points)

1 Answer

+1 vote
You can try starting with something like this, but it's behavior is going to be very browser-specific:

<button type="button" id="fullScreenOn">Enter fullscreen</button>
<button type="button" id="fullScreenOff">Exit fullscreen</button>

        var doc = document.documentElement;
        if (doc.requestFullscreen) {
        else if (doc.msRequestFullscreen) {
        else if (doc.mozRequestFullScreen) {
        else if (doc.webkitRequestFullscreen) {
        if (document.exitFullscreen) {
        else if (document.mozCancelFullScreen) {
        else if (document.webkitExitFullscreen) {

As an alternative, you could use the Sawtooth Script "PopUp" to create a nearly full screen window.
answered Feb 20, 2017 by Zachary Platinum Sawtooth Software, Inc. (147,000 points)
Sorry for being slow to answer.  Your answer works in Firefox but does not do it automatically.  Can it be made self-executing?  It seems there is a "resizeTo" command but browsers defeat it.
I'm not sure if that is doable.  Full screen capabilities are limited by browsers for reasons of security.