Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function goFullScreen()
- {
- // based on https://developers.google.com/web/fundamentals/native-hardware/fullscreen/
- /*
- let documentElement = window.document.documentElement;
- let request = documentElement.requestFullscreen || documentElement.mozRequestFullScreen || documentElement.webkitRequestFullScreen || documentElement.msRequestFullscreen;
- request.call(documentElement);
- */
- let d = window.document.documentElement;
- (d.requestFullscreen || d.mozRequestFullScreen || d.webkitRequestFullScreen || d.msRequestFullscreen).call(d);
- }
- // must be called by an event handler in response to user interaction
- // also, can be safely called multiple times (no need to check if already full screen), request will be simply ignored
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement