Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. wicket: how to make div height dependent on another div
  2. document.getElementById("div1").style.height = document.getElementById("div2").offsetHeight;
  3.        
  4. #div1 { overflow: hidden; }
  5.        
  6. $(document).ready(function() {
  7.   var div2_height = $('#div2').height();
  8.  
  9.   $('#div1').height(div2_height);
  10. });