Maybe telling us on which browser you are testing could help ;-)
Diego On Thu, Jul 14, 2011 at 12:54 PM, Clothears <[email protected]> wrote: > There are some elements in one of my app's pages whose height and > other style values I'd like to get as soon as possible, since I want > to use the values to calculate and set heights of other elements. And > I'd like to be able to either get the element's natural height or one > I set using CSS. > > So, I'm doing something like [1]: > > h = > document.defaultView.getComputedStyle(e,null).getPropertyValue("height"); > > where e is a pointer to my element. > > But I find that if I do this right at the start of the onload > function, I get back a zero value, whereas if I do it a bit later > (e.g. after waiting for some ajax calls to complete), then I get the > proper value. > > So when are these style values set? The reason for this is to avoid > what I do at the moment: compute the true height by hand and just have > a JavaScript variable initialised to that value. > > > [1] If/when I can sort this I can collect the border/margin/padding > values too. > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
