On Feb 12, 7:18 pm, Peter van der Zee <[email protected]> wrote:
> > Umm no. If I take as a specific example the left padding of a <div>,
> > ...
> > pad = parseInt (document.getElementById("xyz").style.paddingLeft);
>
> Yeah. This is "trying to read these values through the el.style object". It
> doesn't work that way. It works in some ways, but it's unreliable. The
> computed styles is by far more reliable.
>
> > But why can I not read it as above?
>
> Because, simply put, that's not how browsers implement it. You need to get
> the computed styles like I've shown you on IE and non-IE.
OK - thanks for that. I'll get acquainted with getComputedStyle then,
and find out more about that issue in general.
I fixed my other problem with window.resizeTo.
> I wonder whether IE9 does getComputedStyle yet...
Can't help there, sorry.
--
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]