Created
January 21, 2012 20:56
-
-
Save samccone/1653975 to your computer and use it in GitHub Desktop.
HTML5 Enter Full Screen Shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// detecting if browser supports fullscreen | |
return document.body.mozRequestFullScreen || document.body.webkitRequestFullScreen || document.body.requestFullScreen; | |
// requesting full screen on an elm | |
( elm.mozRequestFullScreen && elm.mozRequestFullScreen() ) || ( elm.webkitRequestFullScreen && elm.webkitRequestFullScreen() ) || ( elm.requestFullScreen && elm.requestFullScreen() ); | |
//binding to full screen event | |
( document.body.requestFullScreen && window.addEventListener('fullscreenchange',fullScreenEvent) ) || ( document.body.webkitRequestFullScreen && window.addEventListener('webkitfullscreenchange',fullScreenEvent ) ) || ( document.body.mozRequestFullScreen && window.addEventListener('mozfullscreenchange',fullScreenEvent) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment