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

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 24  |  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. jQuery height() differs from clientHeight
  2. <div class="obj">
  3.   <img width="896" height="595" src... />
  4.   <div class="details">
  5.     <h2>Title</h2>
  6.     <p>...</p>
  7.   </div>
  8. </div>
  9. <div class="obj">
  10.   <img width="896" height="595" src... />
  11.   <div class="details">
  12.     <h2>Title</h2>
  13.     <p>...</p>
  14.   </div>
  15. </div>
  16.        
  17. $objs = $('.obj');
  18. $objs.each(function() {
  19.     console.log($(this).height());
  20. }
  21.        
  22. $(window).load(
  23.   function() {
  24.     $objs = $('.obj');
  25.     $objs.each(function() {
  26.         console.log($(this).height());
  27.     }
  28.   }
  29. );