Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

This property is read-only on HTML documents, and read-write on fixed regions.

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.

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


<script type="text/javascript">
function fnCheckScroll(){
    var iNewHeight = oDiv.scrollHeight;
    alert("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
applet
b
bdo
big
blockQuote
body
button
caption
center
cite
code
col
colGroup
custom
dd
dfn
dir
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
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
Reference
scrollLeft
scrollTop
scrollWidth

 

 

Show:
© 2014 Microsoft