我在这里处理一些 javascript svg 图形,我发现我真的不能依赖 Firefox 上的 window.innerHeight(或 outerHeight)的值。我正在运行带有 firefox 18.0.1 的 Ubuntu 12.04,并且在 1366x768 屏幕上,firefox 返回的 window.innerHeight 值为 283。Chrome 在同一屏幕上返回 656。这种巨大的差异有什么原因吗?我四处寻找有这个问题的人,但我发现的只是一张封闭的 jquery ticket。这是我正在使用的代码的骨架:
<!DOCTYPE html>
<html style="border-width: 0px; margin: 0px; width: 100%; height: 100%" xmlns="http://www.w3.org/1999/xhtml">
<!-- Head with some scripts and style -->
<body>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="position:absolute; width:100%; height:100%"
xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" baseProfile="full"
preserveAspectRatio="xMinYMin meet"
viewBox="0 0 1400 700"
onload="Initialize(evt)">
<script type="text/ecmascript"><![CDATA[
Bunch of javascript here
]]></script>
<!-- SVG Element definitions -->
</svg>
</body>
</html>