In Internet Explorer 7 some properties (mouse coordinates) are treated as physical while others are logical (offset). This essentially required Web developers to be aware of or calculate the zoom state. In IE8 release all properties are logical.
+6
A:
You can get it using:
var b = document.body.getBoundingClientRect();
alert((b.right - b.left)/document.body.clientWidth);
Thanks a lot @niclasnorgren!
valums
2009-03-25 08:59:33
+3
A:
There is a small syntax error (body instead of document.body) on the accepted answer. This seems to do the trick also.
var rect = document.body.getBoundingClientRect();
var zoomLevel = Math.round((rect.right-rect.left)/document.body.clientWidth * 100);
Brian Grinstead
2009-05-01 20:38:02