简体   繁体   中英

Animate element over a curve with element.animate()

I need to animate translations of elements over paths such as the one shown below:

De Casteljau的曲线示例

Right now I am using a requestAnimationFrame callback that calculates the position on a De Casteljau curve and then sets the element position via an inline CSS translate3d() .
This works, although it performs worse and is very verbose when compared to CSS animations.

Web Animations seem like a good new option to animate elements when the destination is only known at runtime, but I cannot find anything to modify the animation between the start and end point.

Is it possible to do the above using element.animate() , or is it no more customisable than a CSS animation?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM