什么东西会导致reflow?
其实看了上一篇对reflow的描述, 我们基本能猜到, reflow是不能避免的! 但是我们需要想办法尽量减少reflow.先看看什么会导致reflow, 以下节选自Stubbornella (请原谅我有点粗糙的翻译, 我相信继续翻译的话, 会好起来的~~, 有不足的地方, 请不吝指出!)
导致reflow的情况:
Unfortunately, lots of things. Among them some which are particularly relevant when writing CSS:
* Resizing the window
* Changing the font
* Adding or removing a stylesheet
* Content changes, such as a user typing text in an input box
* Activation of CSS pseudo classes such as :hover (in IE the activation of the pseudo class of a sibling)
* Manipulating the class attribute
* A script manipulating the DOM
* Calculating offsetWidth and offsetHeight
* Setting a property of the style attribute
好了, 来翻译 继续阅读 »


