all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

scrollHeight property

Retrieves the scrolling height of the object.

Syntax

JavaScript

p = object.scrollHeight

Property values

Type: Integer

Pointer to a nonnegative long integer that specifies the height, in pixels.

Remarks

The height is the distance between the top and bottom edges of the object's content.

For more information about how to access the dimension and location of objects on the page through the Dynamic HTML (DHTML) Object Model, see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.

Examples

This example uses the scrollHeight property to retrieve the height of the viewable content.


<script type="text/javascript">
function fnCheckScroll(){
    var iNewHeight = oDiv.scrollHeight;
    console.log("The value of the scrollHeight property is: " 
        + iNewHeight + "px"); 
}
</script>
...
<div id="oDiv" style="overflow: scroll; height= 100px; width= 250px; text-align: left">
	... 
</div>
<button onclick="fnCheckScroll()">Check scrollHeight</button>

See also

a
address
b
bdo
blockQuote
body
button
caption
cite
code
col
colGroup
custom
dd
dfn
div
dl
dt
em
embed
fieldSet
form
head
hn
html
i
img
input type=button
input type=checkbox
input type=email
input type=file
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
kbd
label
legend
li
menu
meta
object
ol
option
p
pre
s
samp
script
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
u
ul
var
Reference
scrollLeft
scrollTop
scrollWidth

 

 

Show:
© 2014 Microsoft. All rights reserved.