Last active
July 9, 2024 08:09
-
-
Save lin71008/ac3be2f120ef5d0ee1664ec0cbca996a to your computer and use it in GitHub Desktop.
test screen size
This file contains hidden or 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
<!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