File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Finding total lenght of DIV Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Finding total lenght of DIV" Watch "Finding total lenght of DIV" New topic

Finding total lenght of DIV

Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
I would like to know the total scrollable area available in my <div> using java script. How do i do that?
The followign code gives only the lenght of div tag area(say 100px)

But there can be more content inside div with scorllbar appearance..say 300px(not sure how much) of content...How do i know the total content lenght.
This i need to know so that I can set the scrollbar to the bottom(as this is my requirement).. Right now I have set the highest value to work..

Is this the way to code? or Is there way to know the exact height of scrollable div area?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385

Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
This works great. Thanks Eric.
I agree. Here's the link:
subject: Finding total lenght of DIV
It's not a secret anymore!