Created
September 12, 2012 01:39
-
-
Save shreyansb/3703602 to your computer and use it in GitHub Desktop.
is the viewing browser in fullscreen mode?
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
<html> | |
<head> | |
<script> | |
function isFullscreen() { | |
if ((window.screen.height === window.innerHeight) && | |
(window.screen.width === window.innerWidth)) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
function showFullscreenStatus() { | |
var el = document.getElementById('status'); | |
if (isFullscreen()) { | |
el.innerHTML = "YES"; | |
} else { | |
el.innerHTML = "NO"; | |
} | |
} | |
window.onload = window.onresize = function(event) { | |
showFullscreenStatus(); | |
}; | |
</script> | |
</head> | |
<body> | |
<div id="status"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment