如何在Internet Explorer 7中获得缩放级别? (JavaScript的) [英] How to get zoom level in Internet Explorer 7? (javascript)

查看:143
本文介绍了如何在Internet Explorer 7中获得缩放级别? (JavaScript的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Internet Explorer 7中,某些属性(鼠标坐标)被视为物理属性,而其他属性则是逻辑(偏移)。这基本上要求Web开发人员了解或计算缩放状态。在IE8版本中,所有属性都是合乎逻辑的。

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.

推荐答案

您可以使用:

var b = document.body.getBoundingClientRect();    
alert((b.right - b.left)/document.body.clientWidth);

非常感谢 @ niclasnorgren

这篇关于如何在Internet Explorer 7中获得缩放级别? (JavaScript的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆