Created
April 21, 2015 04:18
-
-
Save fitsum/898b009da09142ff630e to your computer and use it in GitHub Desktop.
cross-device, modified to launch on click and only cancel on drag from top instead of toggling on click
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
function toggleFullScreen() { | |
var doc = window.document; | |
var docEl = doc.documentElement; | |
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen; | |
var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen; | |
// if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) { | |
requestFullScreen.call(docEl); | |
// } | |
// else { | |
// cancelFullScreen.call(doc); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment