![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I want to get the height of an element and dividing by 2, but i don't know how. See the code: DIV ID="myDiv" STYLE="position:absolute; height:200" ...</div script myObj = document.getElementById("myDiv").style; dw = myObj.height / 2; alert(dw) /script Without dividing, i get '200px'. With dividing, it produces "NaN". I also tried dw=parseFloat( myObj.height / 2). Thanks for help. Dan. |
#3
| |||
| |||
|
|
"Dan" <no (AT) mail (DOT) xy> wrote in message news:bfpi0q$mmi$1 (AT) reader11 (DOT) wxs.nl... Hi, I want to get the height of an element and dividing by 2, but i don't know how. See the code: DIV ID="myDiv" STYLE="position:absolute; height:200" ...</div script myObj = document.getElementById("myDiv").style; dw = myObj.height / 2; alert(dw) /script Without dividing, i get '200px'. With dividing, it produces "NaN". I also tried dw=parseFloat( myObj.height / 2). It should be dw = parseFloat(myObj.height) / 2; |
#4
| |||
| |||
|
|
It should be dw = parseFloat(myObj.height) / 2; |
![]() |
| Thread Tools | |
| Display Modes | |
| |