JavaScript DHTML/Javascript Objects/screen
Содержание
Available Height
<html>
<head>
<title>Screen</title>
</head>
<body>
<script type = "text/javascript" >
document.write("Available Height: " + screen.availHeight);
</script>
</body>
</html>
Available Width
<html>
<head>
<title>Screen</title>
</head>
<body>
<script type = "text/javascript" >
document.write("Available Width: " + screen.availWidth);
</script>
</body>
</html>
screen.availLeft
<html>
<head>
<title>History</title>
</head>
<body>
<script type="text/javascript">
document.writeln("screen.availTop: " + screen.availTop + "<br />");
document.writeln("screen.availLeft: " + screen.availLeft + "<br />");
document.writeln("screen.availWidth: " + screen.availWidth + "<br />");
document.writeln("screen.availHeight: " + screen.availHeight + "<br />");
document.writeln("screen.colorDepth: " + screen.colorDepth + "<br />");
document.writeln("screen.pixelDepth: " + screen.pixelDepth + "<br />");
</script>
</body>
</html>
screen.availTop
<html>
<head>
<title>History</title>
</head>
<body>
<script type="text/javascript">
document.writeln("screen.availTop: " + screen.availTop + "<br />");
document.writeln("screen.availLeft: " + screen.availLeft + "<br />");
document.writeln("screen.availWidth: " + screen.availWidth + "<br />");
document.writeln("screen.availHeight: " + screen.availHeight + "<br />");
document.writeln("screen.colorDepth: " + screen.colorDepth + "<br />");
document.writeln("screen.pixelDepth: " + screen.pixelDepth + "<br />");
</script>
</body>
</html>
screen.colorDepth
<html>
<head>
<title>History</title>
</head>
<body>
<script type="text/javascript">
document.writeln("screen.availTop: " + screen.availTop + "<br />");
document.writeln("screen.availLeft: " + screen.availLeft + "<br />");
document.writeln("screen.availWidth: " + screen.availWidth + "<br />");
document.writeln("screen.availHeight: " + screen.availHeight + "<br />");
document.writeln("screen.colorDepth: " + screen.colorDepth + "<br />");
document.writeln("screen.pixelDepth: " + screen.pixelDepth + "<br />");
</script>
</body>
</html>
"screen" Example
<html>
<body>
<button onclick="alert(screen.width + "x" + screen.height);">
Screen resolution
</button>
</body>
</html>
screen.pixelDepth
<html>
<head>
<title>History</title>
</head>
<body>
<script type="text/javascript">
document.writeln("screen.availTop: " + screen.availTop + "<br />");
document.writeln("screen.availLeft: " + screen.availLeft + "<br />");
document.writeln("screen.availWidth: " + screen.availWidth + "<br />");
document.writeln("screen.availHeight: " + screen.availHeight + "<br />");
document.writeln("screen.colorDepth: " + screen.colorDepth + "<br />");
document.writeln("screen.pixelDepth: " + screen.pixelDepth + "<br />");
</script>
</body>
</html>
Total Height
<html>
<head>
<title>Screen</title>
</head>
<body>
<script type = "text/javascript" >
document.write("Total Height: " + screen.height);
</script>
</body>
</html>
Total Width
<html>
<head>
<title>Screen</title>
</head>
<body>
<script type = "text/javascript" >
document.write("Total Width: " + screen.width);
</script>
</body>
</html>