PDA

View Full Version : size of a form component


delphi_dawg
08-25-2002, 04:26 PM
Hi folks -

is there a way to get the size of a TD
at runtime ???

Here is the code line...

<td width="100%" height="100%" valign="center" align="center" id="map_frame">


I need to get the actual pixel points for the height
and width of the map_frame, in javascript (of course)


thanks
tony

Jon Hanlon
08-25-2002, 06:48 PM
I'd use map_frame.currentStyle.pixelHeight or map_frame.style.pixelHeight

And the corresponding width properties. For IE, anyway. Netscape is different.
currentStyle only came out in IE5, but is extremely useful as it reflects the current style of an object taking into account stylesheets, in-line styles and html.

See here: http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp

delphi_dawg
08-26-2002, 04:52 PM
Hi Jon and all


Thanks for that super nugget of knowledge!!

but - i'm afraid i didn't express my question quite right -
so i'll rephrase....

the main form is divided into four frame quadrants,
ul (upper left), ur (upper right), ll (lower left) and lr (lower right)


they are not resizable -
but they are setup as a percentages -

so the question is - is there a way to get the pixel count of the lr frame?

thanks
tony

Jon Hanlon
08-26-2002, 07:01 PM
You want the clientWidth property of the body:

top.frames.lr.document.body.clientWidth

http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/clientwidth.asp

delphi_dawg
08-30-2002, 06:23 AM
Jon -

Once again - you have saved my bacon!!!

<atta boy> Well done! </atta boy>

thanks again for all your help!!!


take care
tony

kdjoergensen
08-30-2002, 12:50 PM
does anyone have problems with the corresponding clientHeight on IE5.x ?? my tests render this property undefined on NT platforms ?

Jon Hanlon
08-30-2002, 10:49 PM
I've had no problems. Please post a sample of code.