Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixes problem in IE where offsetParent was null, putting after null chec... #1122

Closed
wants to merge 1 commit into from

3 participants

@jqueryninja

...k. Also avoids an unnecessary variable assignment if we are returning out of the function.

jqueryninja Fixes problem in IE where offsetParent was null, putting after null c…
…heck. Also avoids an unnecessary variable assignment if we are returning out of the function.
527e753
@loganfsmyth

I'm running into this too, in Chrome. This fix works for me, and it makes sense since that if statement implies that offsetParent can be null.

@SergioCrisostomo
Collaborator

@jqueryninja and @loganfsmyth Thank you for bringing this up!
The correction you wanted was added here and will be shipped with More 1.5 due to release the next days .

I close this now. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 27, 2012
  1. Fixes problem in IE where offsetParent was null, putting after null c…

    jqueryninja authored
    …heck. Also avoids an unnecessary variable assignment if we are returning out of the function.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  Source/Element/Element.Position.js
View
3  Source/Element/Element.Position.js
@@ -69,9 +69,10 @@ var local = Element.Position = {
offsetParent = element.measure(function(){
return document.id(this.getOffsetParent());
}),
- parentScroll = offsetParent.getScroll();
+ parentScroll;
if (!offsetParent || offsetParent == element.getDocument().body) return;
+ parentScroll = offsetParent.getScroll();
parentOffset = offsetParent.measure(function(){
var position = this.getPosition();
if (this.getStyle('position') == 'fixed'){
Something went wrong with that request. Please try again.