JQuery outerHeight returns invalid IE value

I am trying to get the height of an element on a page. I get the expected value (700 pixels or so) in FF and Webkit on Mac, but I get a value of 0 in IE8. I have not tried earlier versions of IE.

HTML:

<section>
  <article>
   ...
  </article>

JavaScript:

var height = myElement.outerHeight(true);

There are a few things that can complicate this.

  • I am trying to measure an element immediately after it is dynamically added to the page (the element was added as a result of an ajax request),
  • The element I'm trying to measure is the html5 element (section).

One thing I noticed is that the inserted html5 elements are poorly formatted when viewed using the developer tools. I get things like </article/>. Everything that was part of the page upon loading looks fine.

, :

  • css display: html5
  • Remy Sharp "html5 script " (Http://remysharp.com/2009/01/07/html5-enabling- script/)
  • divs html5
  • myElement.height() "auto" IE8, . innerHeight() null.

+5
2

, , , html5 . , </article/>

, , IE DOM. IE HTML5, , , , , , .

, , IE EMPTY: , <img/> <br/>, close ( XHTML). , IE <section>, section. <article>, <section/>, . IE </section>, , close, , /section (, , , , IE ?).

, <section/>, , , , , <article/>.

, html5shiv , createElement, IE, , , <section> . , , , innerHTML, . - innershiv; , , IE, , ( , jQuery html()).

. <section/> , <div class="section"> . , - , IE6-8 . .

+5

IE8 ... , , .

, , , HTML5, HTML5 Shiv, .

+1

All Articles