1. 使用 class 操作样式,而不是频繁操作 style
2. 避免使用 table 布局
3. 批量dom 操作,例如 createDocumentFragment,或者使用框架,例如 React
4. Debounce window resize 事件
5. 对 dom 属性的读写要分离
6. will-change: transform 做优化
WEB性能优化
最新推荐文章于 2024-05-02 09:01:20 发布
1. 使用 class 操作样式,而不是频繁操作 style
2. 避免使用 table 布局
3. 批量dom 操作,例如 createDocumentFragment,或者使用框架,例如 React
4. Debounce window resize 事件
5. 对 dom 属性的读写要分离
6. will-change: transform 做优化