yiminghe / dom-scroll-into-view

scroll dom node into view automatically
156 stars 24 forks source link

Add offset x/y configuration #1

Closed supnate closed 8 years ago

supnate commented 8 years ago

Hi @yiminghe ,

First thank you for providing such a cool component. I want a feature to be added that is allow to set offset x/y as arguments.

In some scenarios, the page has a header fixed on top. The page content has a marginTop so that the main content is scrollable with the document body scroller. Then scroll-into-view doesn't work well because the target dom node is hidden by the top header. If it allows set a offset x to be the header height, the problem will be resolved.

Best regards, Nate

yiminghe commented 8 years ago

welcome your pr

supnate commented 8 years ago

Sure, I will create a pr soon since you agree it's a valid feature.

yiminghe commented 8 years ago

1.2.0