Hi
I m trying to make align and valign but for that i need
the string width and height.
I have look for it in books, forums, scripts and nothing,
can some one help me ???
Thanks for all the help you can give.
Hi
I m trying to make align and valign but for that i need
the string width and height.
I have look for it in books, forums, scripts and nothing,
can some one help me ???
Thanks for all the help you can give.
You will need to be more specific. Strings do not have width or height. If you want to get the width or height of an element, you can but, it depends upon wether these are already defined or not and if defined, how they are defined, as to what method you use. In all cases the element must have been parsed by the browser before you query its dimensions. Here are some examples:
var element=document.getElementById('myID')
//For elements with attribute width & height defined:
alert(element.width);
alert(element.height);
//For elements with style width & height defined:
alert(element.style.width);
alert(element.style.height);
//For elements with no defined width or height
alert(element.offsetWidth);
alert(element.offsetHeight);
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Hi
Thanks for the help.
<td> as the "align" and "valign" how do i do that in a <span>
or <div> ???
Span.height = 100
String(Text).height = 20
to align i do
(Span.height - String(Text).height) / 2 = 40
this is like the valign, but for this i need the String height.
I had the same question!
"element.offsetheight" doesn't work if height is set on "auto".
Need help, please!!!!
greetings
Max
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Danke, man! Your my god!
I didn' know that upper and lower case is important in JS! I started learning it the day I logged in here the first time.
Bookmarks