Skrollr crashes on FF because of wrong body.scrollHeight calculations #131

Closed
castus opened this Issue Feb 6, 2013 · 4 comments

Projects

None yet

2 participants

@castus

Hi,

My skrollr crashed when I installed new Firefox. I make some benchmark on this and found, that Firefox wrong calculate body.scrollHeight. This is why the _reflow() function return me only "1" for _maxKeyFrame variable.
Please use some cross-browser height calculations ( for ex. here http://james.padolsey.com/javascript/get-document-height-cross-browser/ ) in your code.

Thanks for your amazing work,
Christopher

@Prinzhorn
Owner

Could you post an example page?

Everything is fine in FF 18.0.2 for me.

I thought the different methods described in the link you posted are only required when

  • old browser
  • quirks mode (invalid DOCTYPE)

both which I don't care about (with old I mean FF 2 or IE 6).

@castus

Hi,

The site is http://millermusictour.pl (polish language, minified JS). I use forceHeight: false and everything works fine before FF 18 release. I find out that body.scrollHeight is the problem and when I use jQuery or above script to calculate height, everything would work again.

@Prinzhorn Prinzhorn added a commit that closed this issue Feb 8, 2013
@Prinzhorn Properly get the scrollHeight cross-browser. Fixes #131 and #133
We were using body.scrollHeight which does not always hold the correct value.
We are now using the Math.max of five different values to properly get the
scrollHeight cross-browser. This fixes #131
Additionally we unified the _reflow function and use the Math.max of the
document height and the max-keyframe in order to fix #133.
e7e7c55
@Prinzhorn Prinzhorn closed this in e7e7c55 Feb 8, 2013
@Prinzhorn
Owner

Please try with the latest 0.5.13

@castus

Thanks for your help, this is the best parallax plugin I know 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment