title: How to listen for layout changes on a specific HTML element?
body: <p>What are some techniques for listening for layout changes in modern browsers? <code>window.resize</code> won't work because it only fires when the entire window is resized, not when content changes cause reflow.</p>
  
  <p>Specifically, I'd like to know when:</p>
  
  <ul>
  <li>An element's available width changes.</li>
  <li>The total height consumed by the in-flow children of an element changes.</li>
  </ul>