You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If scrollBy is called while a previous call to scrollBy is still "running" the current scrolling operation is canceled and a new one is started at the current position. In some cases, this leads to unintuitive behavior and a bad user experience.
In the following example you can click the "Scroll up" and "Scroll down" buttons to scroll up/down by 300px. Each of the colored rectangles are 300px high. If you do a double click on the "Scroll down" button the content is not scrolled by 600px, but some value between 300 and 600. https://jsfiddle.net/u21e83rq/1/
Add the value of scrollLeft to the left dictionary member.
Add the value of scrollTop to the top dictionary member.
It would be nice if the behavior of scrollBy would be similar to using the "Page up"/"Page down" keys or clicking in the "track-piece" of the scrollbar. (Doing so will not cancel any previous scroll operations but extend the scroll-animation to the new position)
The text was updated successfully, but these errors were encountered:
If
scrollBy
is called while a previous call toscrollBy
is still "running" the current scrolling operation is canceled and a new one is started at the current position. In some cases, this leads to unintuitive behavior and a bad user experience.In the following example you can click the "Scroll up" and "Scroll down" buttons to scroll up/down by 300px. Each of the colored rectangles are 300px high. If you do a double click on the "Scroll down" button the content is not scrolled by 600px, but some value between 300 and 600.
https://jsfiddle.net/u21e83rq/1/
I don't know whether this can be fixed, because the observed behavior is implied by the spec: https://drafts.csswg.org/cssom-view/#dom-element-scrollby
It would be nice if the behavior of
scrollBy
would be similar to using the "Page up"/"Page down" keys or clicking in the "track-piece" of the scrollbar. (Doing so will not cancel any previous scroll operations but extend the scroll-animation to the new position)The text was updated successfully, but these errors were encountered: