采用 JS 来更新样式
div.style.background='red'; div.style.display='none'; div.style.classname='redd'; <!-- 以上是用js代码来更新样式 -->以上图片表示什么含义呢?
第一种:全部都要走(渲染)一遍例如:div.remove()会触发当前消失,其他元素重新 Layout
第二种:跳过 Layout例如:div.style.background='red';改变背景颜色,直接 repaint+compose。
第三种:跳过 Layout 和 paint例如:改变 transform。要在全屏下查看效果,在 iframe 里看有问题。