Getting the height of an element before added to the DOM
Elements don’t have a height, in any real sense, until they’ve been added to the DOM, as their styles cannot be evaluated until then. You can get around this easily enough using visibility: hidden so that the element can be added to the DOM (and its height determined) without causing visible flickering. function test(a) { … Read more