-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
交互动画系列之二:贝塞尔曲线 #56
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
动画的意义
来源:http://wiki.jikexueyuan.com/project/material-design/material-design-intro/introduction.html
来源:Material Desigin
贝塞尔曲线
自然界中的动画绝大多数都不是匀速直线运动的,比如你推一个箱子:先从0快速加速到最大速度,最后在减速到0。随着硬件技术的发展,我们已经可以在计算机模拟并且呈现这样各色的曲线。
ok,现在我要用div模拟这个推箱子。
更多常用的贝塞尔曲线请参考这里:http://easings.net/zh-cn
如果你想自定义贝塞尔曲线,这里有个不错的在线工具:http://cubic-bezier.com
参考资料:https://isux.tencent.com/animation-factor.html
坑
1. margin-left失效
在一开始写上面那个例子的时候,我是这样写的
发现没有效果。
后来才发现是因为只写margin:0 auto的话其实margin-left值是undefined,undefined到300当然不能有动画了。
解决方案是把margin-left单独写
参考资料:http://stackoverflow.com/questions/30587900/css-margin-left-transition-not-working
The text was updated successfully, but these errors were encountered: