Heyho,
I just put myself the question if it is possible to get the size of a DOM element that is not yet appended to the document. There is a content inside and normally the element resizes itself to the size of the content. How do I get this without placing it in the document, reading its size and deleting it?
example:
greetingsCode:var element = document.createElement("div"); var element1 = document.createElement("div"); var textnode = document.createTextNode("Hello, you, I am a node!"); element1.appendChild(textnode); element.appendChild(element1); alert(element.offsetWidth); // of course, that does not work but how then
Max



Reply With Quote

Bookmarks