Skip to content

Instantly share code, notes, and snippets.

View michaelwhyte's full-sized avatar

Michael Whyte michaelwhyte

View GitHub Profile
:-ms-fullscreen {
width: auto;
height: auto;
margin: auto;
}
element.requestFullscreen();
@michaelwhyte
michaelwhyte / exit-fullscreen.js
Last active August 29, 2015 14:06
Code for exiting fullscreen mode using the HTML5 fullscreen API
var btn02 = document.getElementById('btn-02');
// Exit full-screen mode when btn02
// is clicked
btn02.addEventListener('click', function(){
exitFullscreen();
}, false);
@michaelwhyte
michaelwhyte / enter-fullscreen.js
Last active August 29, 2015 14:06
Code for entering fullscreen mode using the HTML5 fullscreen API
var fullscreenAvailable = false;
var btn01 = document.getElementById('btn-01');
// Test to see if
// full-screen is available
if(
document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullscreenEnabled