Skip to content

Instantly share code, notes, and snippets.

@fnando
Created May 1, 2012 21:35
Show Gist options
  • Save fnando/2571613 to your computer and use it in GitHub Desktop.
Save fnando/2571613 to your computer and use it in GitHub Desktop.
Working with fullscreen
var body = document.body;
if (body.requestFullScreen) {
body.requestFullScreen();
} else if (body.mozRequestFullScreen) {
body.mozRequestFullScreen();
} else if (body.webkitRequestFullScreen) {
body.webkitRequestFullScreen();
}
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
$(document).on("fullscreenchange", callback);
$(document).on("webkitfullscreenchange", callback);
$(document).on("mozfullscreenchange", callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment