Forum Discussion

AndrewMaranta-2's avatar
AndrewMaranta-2
Community Member
4 years ago

Here's an easy way to create a fullscreen button in Storyline

Hey all,

Just thought I'd pass along this tip for anyone that wants their users to view their courses in fullscreen.

Here's the example: https://360.articulate.com/review/content/47627759-c0a4-4921-a49a-785772d2f07a/review

To add it yourself, just add this "Execute Javascript" Code to any object and you're good to go.

var elem = document.documentElement;

function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) { /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE11 */
    elem.msRequestFullscreen();
  }
}

function closeFullscreen() {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.webkitExitFullscreen) { /* Safari */
    document.webkitExitFullscreen();
  } else if (document.msExitFullscreen) { /* IE11 */
    document.msExitFullscreen();
  }
}



if(document.fullscreenElement == null){
openFullscreen();
}else{
closeFullscreen();
};

 

 

Cheers,

Andrew

No RepliesBe the first to reply