这个问题似乎只发生在 Firefox 上:
我在页面中包含的有效 dom 元素上出现错误,提示“getBoundingClientRect 不是函数”:
var flashElement = document.getElementById("flash_2ffe3a7c");
结果:
<object type="application/x-shockwave-flash" id="flash_2ffe3a7c" name="flash_2ffe3a7c" data="http://www.url.com/myfile.swf" wmode="transparent" style="top: 0px; left: 0px; z-index: 4102; position: absolute; width: 399px; height: 6px;" width="399" height="6">
flashElement.nodeType 为 1
flashElement.nodeName 是 OBJECT
但
flashElement.getBoundingClientRect未定义。
然而
flashElement.getClientRects是一个函数。
是否存在未定义getBoundingClientRect的已知原因?