Skip to content

Instantly share code, notes, and snippets.

@lin71008
Last active July 9, 2024 08:09
Show Gist options
  • Save lin71008/ac3be2f120ef5d0ee1664ec0cbca996a to your computer and use it in GitHub Desktop.
Save lin71008/ac3be2f120ef5d0ee1664ec0cbca996a to your computer and use it in GitHub Desktop.
test screen size
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>testing</title>
</head>
<body onresize="f()">
<h1 id="screen-info"></h1>
<h1 id="windows-info"></h1>
<script type="text/javascript">
function f() {
document.getElementById('screen-info').innerHTML = "Screen Size:" + screen.width.toString() + "x" + screen.height.toString();
document.getElementById('windows-info').innerHTML = "Window Size:" + window.innerWidth.toString() + "x" + window.innerHeight.toString();
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment