GET THE HEIGHT!!

by wholypantalones

HTML

<div class="no-height">no height</div>
<div class="has-height">has height</div>

CSS

.no-height {
  position:fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  background-color: red;
}

.has-height {
  margin-top: 50px;
  padding: 10px;
  background-color: green;
  height: 100px;
}

JavaScript

$(document).ready(function() {
  setTimeout(function() {
    var noHeight = $('.no-height').outerHeight();
    var hasHeight = $('.has-height').outerHeight();
    console.log('ready', noHeight, hasHeight);

  }, 100);
});