<!DOCTYPE html>
<html>
<body onload="checkResolution()">
Your screen width: <element id="Show-Width"><br>
Your screen height: <element id="Show-Height">
<script>
function checkResolution() {
var screenWidth = window.screen.width * window.devicePixelRatio;
document.getElementById("Show-Width").innerHTML = screenWidth;
var screenHeight = window.screen.height * window.devicePixelRatio;
document.getElementById("Show-Height").innerHTML = screenHeight;
}
</script>
</body>
</html>
Dlaczego funkcja pokazuje mi tylko element Show-Width, a ignoruje całą Show-Height? Może wiecie. Hmm... :-) Dziękuję!
Kuba