You will have to do your own (fuzzy) math. You can get the size of the window in pixels (document.width, document.height), but any attempt to get the actual size in inches, is, well... impossible. Everyone's got a different size monitor, and everyone's got a different resolution setup, so the best you can do is guess.
Generally, for low-res (640 x 480) configurations, you can estimate about 72 pixels per inch, for a 15-inch monitor. But this could be the same for a 17-inch monitor setup for 800 x 600. For a modern high-res monitor setup at about 1024 x 768 or 1280 x 1024, you can estimate about 96 pixels per inch. But in reality, the range can be anything in between, or higher.
There are also ways to get the resolution and color depth setup, so you can possibly estimate a little better. The methods are of course different for Netscape and IE, not to mention probably unavailable on most other browsers.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.