Skip to content

Instantly share code, notes, and snippets.

@tomswatermelon
Last active August 29, 2015 13:57
Show Gist options
  • Save tomswatermelon/9612619 to your computer and use it in GitHub Desktop.
Save tomswatermelon/9612619 to your computer and use it in GitHub Desktop.
Javascript fullscreen button example
//fullscreen
function launchFullScreen(element) {
console.log('go fl');
if (element.requestFullscreen) {
element.requestFullscreen();
}
else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
}
else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}
$('#btn_fullscreen').click(function(){
console.log('fullscreen');
launchFullScreen(document.getElementById('wrapper'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment