开发者

Event when CSS is done

开发者 https://www.devze.com 2023-01-21 00:33 出处:网络
At a certain stage, I am applying CSS to a section of my page. Is there an event one can get once the re-layout has comp开发者_开发百科leted?You can define and trigger custom events:

At a certain stage, I am applying CSS to a section of my page.

Is there an event one can get once the re-layout has comp开发者_开发百科leted?


You can define and trigger custom events:

Binding the custom event:

$("#section").bind("layoutchange", function() {
    // stuff to do when the layout changes
});

Triggering the custom event:

$("#secton").css({propertyX: otherValue }).trigger("layoutchange");

However, this custom "layoutchange" event is not related to the actual reflow being completed, but one can assume that the reflow is fast enough, so that by the time you execute the handler it has been completed.

0

精彩评论

暂无评论...
验证码 换一张
取 消