EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.
11 di 15 hanno valutato il contenuto utile: - Valuta questo argomento

clientHeight property

Retrieves the height of the object including padding, but not including margin, border, or scroll bar.

Syntax

JavaScript

p = object.clientHeight

Property values

Type: Integer

the height of the object, in pixels.

Examples

This example shows how the clientHeight property and the offsetHeight property measure document height differently. The height of the div is set to 100, and this is the value retrieved by the offsetHeight property, not the clientHeight property.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/clientHeight.htm


<div id="oDiv" style="overflow: scroll; width: 200px; height: 100px">
    . . . </div>
<button onclick="alert(oDiv.clientHeight)">client height</button>
<button onclick="alert(oDiv.offsetHeight)">offset heightY</button>

See also

a
address
applet
b
bdo
big
blockQuote
body
button
caption
center
cite
code
col
colGroup
custom
dd
dfn
dir
div
dl
dt
em
embed
fieldSet
form
hn
html
i
img
input type=button
input type=checkbox
input type=file
input type=image
input type=password
input type=radio
input type=reset
input type=submit
input type=text
isIndex
kbd
label
legend
li
listing
marquee
menu
meta
noBR
object
ol
option
p
plainText
pre
s
samp
script
select
small
span
strike
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
tt
u
ul
var
xmp
Measuring Element Dimension and Location with CSSOM in Internet Explorer 9

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Il documento è risultato utile?
(1500 caratteri rimanenti)

Aggiunte alla community

AGGIUNGI
Microsoft sta conducendo un sondaggio in linea per comprendere l'opinione degli utenti in merito al sito Web di MSDN. Se si sceglie di partecipare, quando si lascia il sito Web di MSDN verrà visualizzato il sondaggio in linea.

Si desidera partecipare?
© 2013 Microsoft. Tutti i diritti riservati.