How I do I make controls/elements move with inertia?

后端 未结 5 1862
灰色年华
灰色年华 2021-01-31 12:21

Modern UI\'s are starting to give their UI elments nice inertia when moving. Tabs slide in, page transitions, even some listboxes and scroll elments have nice inertia to them (

5条回答
  •  野的像风
    2021-01-31 12:56

    Mike F's got it: you apply a time-position function to calculate the position of an object with respect to time (don't muck around with velocity; it's only useful when you're trying to figure out what algorithm you want to use.)

    Robert Penner's easing equations and demo are superb; like the jQuery demo, they demonstrate visually what the easing looks like, but they also give you a position time graph to give you an idea of the equation behind it.

提交回复
热议问题