Java Script & DOM/Java Script

방문자의 브라우저 스크린의 정보 탐색: screen 객체

본클라쓰 2010. 12. 16. 10:04

방문자의 브라우저의 스크린 정보를 확인하기 위한 객체로 screen 객체가 있다.

 

document.write("Total width/height: ");
document.write(screen.width + "*" + screen.height);
document.write("<br />");
document.write("Available width/height: ");
document.write(screen.availWidth + "*" + screen.availHeight);
document.write("<br />");
document.write("Color depth: ");
document.write(screen.colorDepth);
document.write("<br />");
document.write("Color resolution: ");
document.write(screen.pixelDepth);

 

 

위 코드의 결과)

Total width/height: 1280*800
Available width/height: 1280*770
Color depth: 32
Color resolution: undefined