I've been reading some guides and results that google throws at me but I am still not sure how to go about to reduce the following changes to one single reflow.
var el1 = document.getElementById("one");
var el2 = document.getElementById("two");
var el3 = document.getElementById("three");
var variable1 = getSomeDynamicValue();
function doChanges() {
el1.style.cssText = "width: " + variable1 + "px;";
el2.style.cssText = "top:50px; left: 50px; position: fixed;";
el3.style.cssText = "";
}
doChanges();
As I understand, cssText causes a reflow, so with this code there will be three reflows? Or does it depend on other circumstances?
Edit: The articles and similar post's don't really give a definitive answer to my question. Is it possible? Which is the method?