detect-zoom
detect-zoom copied to clipboard
Incorrect browser zoom under MSIE9 and zoom set to 105% or 110%
When setting the zoom value to 105% or 110% under MSIE9, detect-zoom will give a value of 1.04... and 1.09... respectively. The expected values are 1.05 and 1.1 respectively.
In order to correct these values, I suggest to replace line 59:
var zoom = screen.deviceXDPI / screen.logicalXDPI;
by:
var zoom = Math.floor(screen.deviceXDPI*100 / screen.logicalXDPI + 0.9) / 100;