Side navigation
#759 closed bug (fixed)
Opened January 06, 2007 11:58PM UTC
Closed January 20, 2007 08:48AM UTC
Last modified June 20, 2007 02:48AM UTC
Minor bug in getPosition method of Interface plugin.
Reported by: | jeffkretz@hotmail.co | Owned by: | stefan |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | interface | Version: | |
Keywords: | getPosition | Cc: | |
Blocked by: | Blocking: |
Description
Part of the getPosition function walks up the DOM to the body element to get the scroll position of the page.
while (el && el.tagName.toLowerCase() != 'body')
I had a situation whereby a parent element had no tag, and this method threw an exception. I suggest this implementation which solves the issue:
while (el && el.tagName && el.tagName.toLowerCase() != 'body')
Stefan, feel free to grab the .offset() method in the dimensions plugin and use it. It takes care of this issue and several others.