简体   繁体   English

如何知道一个耗时的 CSS 操作(渲染)已经完成

[英]How to know that a time consuming CSS operation (rendering) has completed

有没有办法知道一个耗时的 CSS 操作(在移动设备上设置大页面的 webkit 列)何时完成?

You can do the following:您可以执行以下操作:

  1. Set callback with setTimeout with the minimal time, 1 millisecond for example.使用 setTimeout 以最短时间设置回调,例如 1 毫秒。
  2. Do your CSS operations.做你的 CSS 操作。
  3. Your callback will be invoked as fast as CSS operations will be completed and browser will be ready for new actions.您的回调将在 CSS 操作完成并且浏览器为新操作做好准备时被调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM