get the height of a div's full content with jQuery - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

get the height of a div's full content with jQuery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from  www  .j  a  v a 2s.  c  o m
console.log($('#x')[0].scrollHeight);
    });

      </script> 
 </head> 
 <body> 
  <div id="x" style="height: 100px; overflow: hidden;"> 
   <div style="height: 200px;">
     pancakes 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials