CSS3 跨弧平移
当前的 CSS3 是否有可能沿着圆弧或曲线平移对象(特别是 DIV)?这是一张图片来帮助说明。
Is it at all possible with current CSS3 to translate an object (specifically a DIV) along an arc or curve? Here's an image to help illustrate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用嵌套元素,并使包装器和内部元素沿相反方向旋转,以便内部元素的旋转补偿包装器的旋转。
如果不需要保持嵌套元素水平,则可以省略内旋转。
这是一个 Dabblet。堆栈片段:
另外,Lea Verou 就这个问题写了一篇文章,采用了一种仅使用一个元素的方法:
You can use nested elements and make the wrapper and inner element rotate in opposite directions so that the rotation of the inner element compensates for the rotation of the wrapper.
If you don't need to keep the nested element horizontal, you can omit the inner rotation.
Here is a Dabblet. Stack Snippet:
Also, Lea Verou wrote an article on this issue with a way that use only one element: http://lea.verou.me/2012/02/moving-an-element-along-a-circle/
是的,可以使用 transform-origin CSS3 属性来创建该动画,以将旋转点设置在最右侧,以便它像那样移动。
看看:http://jsfiddle.net/Q9nGn/4/ (把鼠标悬停)
Yes, that animation can be created using the transform-origin CSS3 property to set the rotation point in the far right so it moves like that.
Check it out: http://jsfiddle.net/Q9nGn/4/ (put your mouse over)
移动变换原点的另一种方法是使用双重嵌套元素,其中将 x 变换应用于外部容器,并将具有适当缓动曲线的 y 变换应用于内部容器。
An alternative to moving the transform origin, is to use a double nested element where an x-transform is applied to the outer container, and a y-transform with an appropriate easing curve is applied to the inner container.