Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xjq7 committed Aug 7, 2024
1 parent c972107 commit 477bda7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/Knowledge/Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ Chrome 浏览器开发工具中的一个功能板块, 用于分析网页性能,

- will-change

告知浏览器该元素会有哪些变化, 让浏览器在元素属性发生变化前能够进行一些优化, 例如元素点击时发生变化优化可以将 will-change 加在 元素 hover 状态上, 另一个
例子是针对元素 hover 时发生变化可以 在他的父级元素的 hover 上声明 该元素 will-change 属性

- CSS 动画优于 JS 动画

- 在使用 JS 动画时可以采用适当的防抖节流优化性能

- 添加 transform:translate3d(0,0,0) 让动画独立图层 触发 GPU 加速

### JS 性能优化

通过 DevTools 分析 Js 运行性能, 找出长任务并优化
Expand Down

0 comments on commit 477bda7

Please sign in to comment.