dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: DIV height

  1. #1
    Join Date
    May 2009
    Location
    The Midwest,
    Posts
    12

    DIV height

    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.

  2. #2
    Join Date
    Oct 2006
    Posts
    939
    offsetHeight

    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.

  3. #3
    Join Date
    May 2009
    Location
    The Midwest,
    Posts
    12
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles