Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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 12 years ago by brandon

Resolution: fixed
Status: newclosed

This is now fixed in SVN.

comment:2 Changed 12 years ago by brandon

Milestone: 1.2.11.2.2
Note: See TracTickets for help on using tickets.