Skip to content

Instantly share code, notes, and snippets.

@spite
Created January 19, 2014 15:23
Show Gist options
  • Save spite/8506285 to your computer and use it in GitHub Desktop.
Save spite/8506285 to your computer and use it in GitHub Desktop.
Going Fullscreen
var c = document.body;
document.getElementById( 'fullscreenBtn' ).addEventListener( 'click', function( e ) {
c.onwebkitfullscreenchange = function(e) {
c.onwebkitfullscreenchange = function() {
};
};
c.onmozfullscreenchange = function(e) {
c.onmozfullscreenchange = function() {
};
};
if( c.webkitRequestFullScreen ) c.webkitRequestFullScreen();
if( c.mozRequestFullScreen ) c.mozRequestFullScreen();
e.preventDefault();
}, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment