473,395 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

reading style value

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
Dec 14 '06 #1
2 1078
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.
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 ?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 14 '06 #2
Ward Germonpré wrote:
I want to position:fixed the columnheaders in a scrollable table an
intend to use this strategy:
Creating cross-browser locked table header code is tricky. I prefer to
separate the IE world from the rest of the world, and use stuff like this:
http://www.javascripttoolbox.com/lib/scrollingdatagrid/

It might provide a few ideas, at least ;)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eddie | last post by:
When I use JavaScript to read an element's textDecoration style, I only get one value even if there are more than one in the sytle sheet. For example if the text-decoration is defined as:...
5
by: Joe | last post by:
Hi, This may seem like a strange thing to want to do, but here goes ... Given an arbitrary element in an HTML page (eg. <td id="bob">...), is there a method I could use to fetch the...
24
by: Hendrik Schober | last post by:
Hi, I have a 'std::istream' and need to read its whole contents into a string. How can I do this? TIA; Schobi
3
by: Fabian | last post by:
How can I read the object.style.display attribute? With teh following: var x = object.style.display; I always get a result of undefined. Solutions? -- -- Fabian
2
by: awoodgate | last post by:
Hi, I'm trying to read the width of a css absolutely positioned element in javascript. If I use an id selector or a class definition then the width is null, but if I use an inline style then it...
1
by: j7.henry | last post by:
I am trying to pull specific data that is in a comma delimited file into a web page. So if my comma delimited file looks like: Name,Address,Zip Fred,123 Elm,66666 Mike,23 Jump,11111 I would...
5
by: prasanta | last post by:
Hello, I have a xml file. when i am trying to load through XPathDocument and try to get XPathNodeIterator its not working . my xml is loking like <?xml version="1.0" ?> <?mso-application...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
4
by: matt urbanowski | last post by:
Hi, I have a stylesheet (.css) file with classes in e.g. ..csHeader_tdLogo { background-position: top left; vertical-align: top; background-image: url(Images/Header_Logo.gif); width: 171px;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.