#1651 closed bug (fixed)
obscure offset bug in IE
Reported by: | wizzud | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | core | Version: | 1.2 |
Keywords: | offset | Cc: | |
Blocked by: | Blocking: |
Description
The inclusion of an HTML element with an id of 'box' causes IE to fail in the offset method, reporting that "Object doesn't support this property or method" and relating to elem.getBoundingClientRect(). This is even though it has just passed a logic test for it!
The solution is to declare box locally, ie change
box = elem.getBoundingClientRect();
to
var box = elem.getBoundingClientRect();
The problem and solution can be seen demonstrated at http://www.wizzud.com/tester/offset_quirks.html or http://www.wizzud.com/tester/offset_standard.html (quirks mode or standard mode respectively). Click 'fix #box bug' to run fixed code.
The demo is set up such that offset is called on the #box element itself, but it will still fail if #box exists anywhere on the page and offset() is called on any other element.
Change History (2)
comment:1 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 16 years ago by
Milestone: | 1.2.1 → 1.2.2 |
---|
This is now fixed in SVN.