scrollHeight property

all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize
This topic has not yet been rated - Rate this topic

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
div
dl
dt
em
embed
fieldSet
form
head
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
kbd
label
legend
li
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

 

 

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.