-
Notifications
You must be signed in to change notification settings - Fork 863
Infinite loop FireFox when scrolling to top #13
Comments
@willemliu - Is there a way for me to test this? I've used it to successfully scroll to the top of the page before. If there were an infinite loop, wouldn't it either:
I've not encountered either of those. |
I had this problem on my not yet complete website. My site using the Zurb Foundation responsive framework. So it's hard to pinpoint what combination of code would exactly cause the bug to appear. |
I'll try to recreate the problem with a simple page tomorrow. |
@willemliu - If the code you provided solves the problem for you, no need. I'll make the updates and test later. Thanks! |
Yes, The line of code fixes the bug. Thanks! Regards, Willem |
Added in version 2.9. Thanks for the bug fix @willemliu! |
Hi,
I've encountered a problem in FireFox caused by a line of code. Line 86 in smooth-scroll.js present in commit: ad413a4 and probably some earlier commits as well.
The following IF-construction causes an infinite loop if you placed an anchor at the top of the page and you want to scroll to that anchor.
When looking into that if statement it's actually expected behaviour for it to cause an infinite loop. ((endLocation(anchor) || 0)) will actually be "false" when the anchor is at position 0 or smaller. So the body of the IF statement will only be executed when "travelled" is smaller or equals "false" which most of the time is never.
And as a result of the use of easing functions "travelled" will most likely never be exactly 0.
You can replace that with the following line to fix the bug.
Regards,
Willem
The text was updated successfully, but these errors were encountered: