This time, there is JavaScript code that checks the monitor environment used by the user or developer,
so let's look at the code that allows you to check those things.
Why do we even need to do something like this?
Let's think about it this way
If, depending on whether the user is viewing on a 30-inch monitor, a 17-inch, a 7-inch, or a smartphone,
you want to compose a screen or service optimized for each.
" And the screen figures it out by itself. "
(= which is possible because, as I rambled on earlier, this is a non-object-oriented based language ! )
In truth,
in practice, different methods are used for N-screen,
but my personal opinion is that having the experience and idea that you can also apply it this way will surely be helpful later.
" Not just for programming, but to develop the problem-solving ability to live life. "
|
|
<!DOCTYPE html> |
|
|
<html> |
|
|
<head> |
|
|
<meta charset="utf-8" /> |
|
|
<title>screen객체</title> |
|
|
<script type="text/javascript"> |
|
|
//<![CDATA[ |
|
|
|
|
|
document.write("화면전체 height :" +screen.height + "<br />"); |
|
|
document.write("화면전체 width :" +screen.width + "<br />"); |
|
|
|
|
|
document.write("사용가능한 화면전체 height :" +screen.height + "<br />"); |
|
|
document.write("사용가능한 화면전체 width :" +screen.width + "<br />"); |
|
|
|
|
|
document.write("화면색상수 :" +screen.colorDepth + "<br />"); |
|
|
document.write("픽셀당 화면 해상도 :" +screen.pixelDepth + "<br />"); |
|
|
|
|
|
document.write("사용가능한 x축좌표 :" +screen.availLeft + "<br />"); |
|
|
document.write("사용가능한 y축좌표 :" +screen.availTop + "<br />"); |
|
|
|
|
|
//]]]]> |
|
|
</script> |
|
|
</head> |
|
|
|
|
|
<body> |
|
|
|
|
|
</body> |
|
|
</html> |
