Skip to content

Instantly share code, notes, and snippets.

@shreyansb
Created September 12, 2012 01:39
Show Gist options
  • Save shreyansb/3703602 to your computer and use it in GitHub Desktop.
Save shreyansb/3703602 to your computer and use it in GitHub Desktop.
is the viewing browser in fullscreen mode?
<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