reading style value

W

Ward Germonpré

Hi,


I know you can position an element using a style property like so :

element.style.left=200px;

But how can you READ an elements style.left property ?



I want to position:fixed the columnheaders in a scrollable table an intend
to use this strategy:

First I dynamically construct the table, and when it's attached to the
document, I want to read the coordinates of the columnheaders and then
'fix' them using a different classname that I set up with 'position fixed'
in my stylesheet.

Can this work ?

thx

Ward
 
E

Evertjan.

Ward Germonpré wrote on 14 dec 2006 in comp.lang.javascript:
I know you can position an element using a style property like so :

element.style.left=200px;

No, it should be a string!

element.style.left='200px';

Only usefull if the element has an absolute/relative position, methinks.
But how can you READ an elements style.left property ?

alert( element.style.left );
I want to position:fixed the columnheaders in a scrollable table an
intend to use this strategy:

eh?

Please show a scarce example code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top