Web Analytics Made Easy -
StatCounter Getting Height - CodingForum

Announcement

Collapse
No announcement yet.

Getting Height

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Height

    does anyone know why I cannot get the height of an element when it is defined by css, but I can when I add the actual style attribute?

  • #2
    Had the same problem myself the other day, and solved it the same way. Ugly, but if it works, it works. Ugh.
    Be yourself. No one else is as qualified.

    Comment


    • #3
      just figured it out use scrollHeight
      Code:
      document.getElementById('id').scrollHeight;

      Comment


      • #4
        Of course, that is *NOT* part of any standard, unfortunately.

        If it works in all the browser your users have, great. But I'd rather use something that is in a standard, if I have a choice. But yeah, you might not have a choice for this.
        Be yourself. No one else is as qualified.

        Comment


        • #5
          Yeah It's worked in FF and IE. I don't have any other browsers installed to test in right now.

          Comment

          Working...
          X