/    Sign up×
Community /Pin to ProfileBookmark

I’m trying to find out what a div’s height is. The div will be repeated and the height will vary, the problem is that I cant just use

document.getElementbyId(blah).style.height

because I’ve purposely cut off the bottom part of the div to be revealed via a separate javascript function. I want the javascript function to slide open the box revealing the rest of the text in the box, but I need to know how far to open it, or basically tell the function when to stop making the box bigger.

Basically, is there a way with the HTML DOM to extract a number for what a
auto height would be for a DIV?

any help would be much abliged.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@justinbarneskinNov 10.2009 — [B]offsetHeight[/B]

A cross browser (non W3C DOM) property that returns the height of the element, including borders and padding if any, but not margins. In IE6, if a validdoctype is not specified, margins/padding are NOT included in the returned value.
Copy linkTweet thisAlerts:
@nibbcnobleauthorNov 13.2009 — I just decided that the best way is that each box will have to have its height specified. Not the best way to do it... adds a lot of work, but its better than the incompatible options which are available.
×

Success!

Help @nibbcnoble spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...