Doug Cassidy
Doug Cassidy

Reputation: 1907

scrollIntoView(true) is not scrolling to top, because of 'scrollable ancestor'. How do I get my element to be at the top of the view screen?

The docs say .scrollIntoView(true):

true - the top of the element will be aligned to the top of the visible area of the scrollable ancestor
[...]
Note: Depending on the layout of other elements, some elements may not be scrolled completely to the top or to the bottom.

ok, well how to I get it to scroll to the top, actually? I want my element to be the first visible thing, in the viewport.

Upvotes: 1

Views: 348

Answers (0)

Related Questions