Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Support for overflow scroll #152

@ErikVeland

Description

@ErikVeland

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions