Not following what

> if it was in place of

is intended to mean?

It is currently possibble to scroll to any portion of the viewport and get
the current position of any element during `scroll` event.

What is being proposed that is not already possible?

On Fri, Jun 21, 2019 at 2:30 PM Adam Eisenreich <[email protected]> wrote:

> I mean, that there should be an API that would say, how an element would
> scroll, if it was in place of for example a `<canvas>`.
>
>
> ```
> const scrollArea = new ScrollArea(canvasElement, {
>   borderBox: 'unlimited', // Default would be the element
>   //viewPort: '100#200'
> });
>
> scrollArea.addEventLisener('scrollStart', event => {
>   console.log(event.endOffsetPosition);
>   console.log(event.currenOffset);
>   console.log(event.deltaX);
>   // Possibly others
> });
> scrollArea.addEventLisener('scroll', () => {});
> scrollArea.addEventLisener('scrollEnd', () => {});
> ```
> Or,
> ```
> function step(timestamp) {
>   canvas.translate(scrollArea.currentOffset.top,
> scrollArea.currentOffset.left);
>   requestAnimationFrame(step);
> }
>
> requestAnimationFrame(step);
> ```
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to