View Single Post
  #2 (permalink)  
Old May 7th, 2007, 01:57 PM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As you are finding, style behavior that is dictated by a style sheet is not "readable" in the same way as styles that are applied using the style="..." inline attribute. However, there is usually a way of reading it.

When an element is drawn on the page it always has height and width and other similar properties (even if they are determined automatically by the browser based on the flow of the page versus being assigned specifically by an inline style or a CSS setting). This values are often available by prefixing "offset" to the style in question. Try using something like this:

document.getElementById('idname').style.offsetHeig ht

You can try the "offset" prefix for other values too:

.offsetWidth
.offsetLeft
.offsetTop
etc.

Hope that works for you.

-Peter