You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
This took me quite some time to fix. I thought support for scrolling a div would be as easy as changing this.$win = $(window); to this.$win = $('.onCanvas'); which in theory should work. Many hours of debugging later I found that the fix was to change the getPositions function from topPos = $target.offset().top; to topPos = $target.position().top;
offset().top returns the elements position relative to the document, whereas position().top returns the position relative to its parent element. I believe you can safely change this to support both document scroll and overflow scroll.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This took me quite some time to fix. I thought support for scrolling a div would be as easy as changing this.$win = $(window); to this.$win = $('.onCanvas'); which in theory should work. Many hours of debugging later I found that the fix was to change the getPositions function from topPos = $target.offset().top; to topPos = $target.position().top;
offset().top returns the elements position relative to the document, whereas position().top returns the position relative to its parent element. I believe you can safely change this to support both document scroll and overflow scroll.
The text was updated successfully, but these errors were encountered: