W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [cssom-view][css-snappoints] scrollIntoView() with block/inline offset

From: Sebastian Zartner <sebastianzartner@gmail.com>
Date: Tue, 26 Jan 2016 09:28:11 +0100
Message-ID: <CAERejNbqMmkUO4kLi+M-ZK0ZMyyvsNwfreCcocbqGxAy5UJn2w@mail.gmail.com>
To: Merih Akar <merih@zeplin.io>
Cc: www-style list <www-style@w3.org>
On 25 January 2016 at 12:07, Merih Akar <merih@zeplin.io> wrote:
> I searched the archives but couldn't find any discussion about this:
> Sometimes I feel the need to scroll an element into the view with some offset so that it's not completely aligned with it's container, and visually in a more appropriate place. Because of this, I abandon using scrollIntoView() and use scrollBy()/scrollTo() with the element's bounding client rect plus/minus that offset. What would you think about adding two new options to ScrollIntoViewOptions such as blockOffset and inlineOffset which will be the distance between the element and its container after the element is scrolled into view?

This was already mentioned before[1], though didn't get any response,
as far as I can see. I personally support this idea.
Another way would be to extend this API to allow to scroll to some
scroll snap point.


[1] https://lists.w3.org/Archives/Public/www-style/2012Jun/0455.html
Received on Tuesday, 26 January 2016 08:29:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:00 UTC