Can I do anything about “repaints on scroll” warning in Chrome for “overflow:scroll” div

后端 未结 4 512
执念已碎
执念已碎 2020-12-12 22:03

In Chrome DevTools, under Rendering, there\'s an option to \"Show potential scroll bottlenecks\".

When I enabled this, some div elements I have on the s

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 22:30

    Nope, you cant modify that, it is a Chrome function to allow you to know, what's painted each update in the window.

    Updates can be a lot of different things (scroll, mousemove, interval, requestanimationframe,...).

    But, now you know that, you can enhance your code.

    If (I dont know), the browser alway re-paint a div if it is set to overflow scroll you maybe can do some JS to set to overflow hidden when out of screen...

    This post talk about different Browser layout

提交回复
热议问题