Because the amount of computation is related to each re-typesetting, most browsers optimize the re-typesetting process through queued modification and batch display. However, you can
Can (often involuntarily) force queues to refresh and require that all planned changes be applied immediately. Getting layout information will cause the brush
New queue actions, which means that the following methods are used:
? OffsetTop, Offsetleft, offsetwidth, offsetheight
? ScrollTop, ScrollLeft, ScrollWidth, scrollheight
? ClientTop, ClientLeft, ClientWidth, clientheight
? getComputedStyle () (Currentstyle in IE) (this function is called currentstyle in IE)
The layout information is returned by these properties and methods to the latest data, so the browser has to run the items in the render queue to be changed and rearrange
Version to return the correct value.
In the process of changing styles, it is best not to use the attributes listed earlier. Any access will flush the render queue, even if you are
Get layout information that hasn't changed recently or has nothing to do with the latest changes.
Front-end performance optimizations: Which DOM action queries cause a refresh of the render tree?