Is there a way to apply multiple CSS styles in a batch to avoid multiple reflows?

前端 未结 5 935
别跟我提以往
别跟我提以往 2020-12-30 05:56

I know that altering element\'s style via JavaScript directly will cause a reflow. However, I was wondering if it is possible to alter multiple style values in a batch with

5条回答
  •  萌比男神i
    2020-12-30 06:38

    You could set the element's visibility to 'hidden', then apply the styles and then make it visible again.

提交回复
热议问题