debiki / utterscroll

Enables dragscroll on your website. Automatically detects when you want to select text, not scroll.
34 stars 8 forks source link

kinetic scrolling #4

Closed guyisra closed 9 years ago

guyisra commented 10 years ago

is there a plan (or a way) to add kinetic / flick scrolling to utterscroll?

it seems as if in the demo (wide commenting demo) it seems natural to aid in the scrolling

kajmagnus commented 10 years ago

Hi Guyisra, I don't currently have any plan to add kinetic scrolling.

To implement kinetic scrolling, I think one would modify Utterscroll so the function doScroll was called for a while after mouseup, so it continued scrolling for a while, but less and less. This could be done by "splitting" stopScroll() (which is called on mouseup) into two functions, startKineticScrolling(), which would be called on mouseup, and stopScrolling() which would be called by a timer after one second or so.

And (of course) variables that remembers the last scroll direction, and how much time has elapsed since mouseup.