Skip to content
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

reflow和repaint引发的性能问题 #2

Open
kagawa23 opened this issue Jul 25, 2018 · 1 comment
Open

reflow和repaint引发的性能问题 #2

kagawa23 opened this issue Jul 25, 2018 · 1 comment
Labels

Comments

@kagawa23
Copy link
Owner

https://juejin.im/post/5a9372895188257a6b06132e#heading-0

@kagawa23
Copy link
Owner Author

优化点

  • 用translate替代top
  • 用opacity替代visibility
  • 不要一条一条的修改dom的样式,预先定义好class,然后修改dom的className
  • 把dom离线后修改,比如:先把dom给display:none(又一次reflow),然后修改100次,然后再显示出来
  • 不要把dom结点的属性值放在一个循环里当成循环里面的变量
  • 不要使用table布局,可能很小的一个小改动会造成整个table的重新布局
  • 动画实现的速度选择
  • 对于动画新建图层
  • 启用GPU硬件加速 新建图层 组合图层也需要时间

@kagawa23 kagawa23 added the 前端 label Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant