Bug Tracker

Opened 15 years ago

Last modified 14 years ago

#1149 closed bug

offsetParent exception in MSIE — at Initial Version

Reported by: offwhite Owned by: john
Priority: major Milestone: 1.1.3
Component: interface Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:


There is a bug in IE when using offsetParent. It is explained at the link below. I came across this problem and was able to work around the problem with a try/catch block as shown in the code below.

Is there another way to this? I noticed there are no try/catch blocks in the rest of the code. Is there a reason to avoid them?

Error explained: http://weblogs.asp.net/rajbk/archive/2006/11/29/ie-6-7-unspecified-error-when-accessing-offsetparent-javascript.aspx

getPositionLite : function(el) {

var x = 0, y = 0; while(el) {

x += el.offsetLeft y += el.offsetTop

try {

el = el.offsetParent;

} catch (e) {

el = null;


} return {x:x, y:y};


Change History (0)

Note: See TracTickets for help on using tickets.