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