title: jQuery - Automatic change values after resizing the browser window
body: <p>We have following code (addition, the presence of the plugin DataTables)</p>
  
  <pre><code>$('#myTable').dataTable( {
        "scrollY":  height, &lt;-- auto height here
        "scrollCollapse": true,
  } );
  </code></pre>
  
  <p>I dont' know so well jquery and I have a problem with the automatic changing values.</p>
  
  <p>I have a div element where the height is a percentage (for example: 50%) and 
  and I want to get this height in pixels. Ofcourse the height is changing as many times as the browser window is changed.</p>
  
  <p>Unfortunately, I don't know how to do, Someone here can help? (preferably an example)</p>
  
  <p>Update 1:</p>
  
  <p>I tried so like that</p>
  
  <pre><code>    var ch = $('#dataTableWrapper').height() - 110; // I subtracted the value of the height of my static elements in a div 
  
      $('#dataTableID').dataTable( {
          "scrollY": ch,
          "scrollCollapse": true,
      } );
  
      $(window).resize(function(){
          ch = $('#dataTableWrapper').height() - 110; // same as above
          $('.dataTables_scrollBody').css('height', ch);
      });
  </code></pre>
  
  <p>Apparently it works, but if anyone had a more elegant solution I would ask about throwing code.</p>