title: Can't add maxHeight into function to add and re-size the height of a class
body: <p>My goal is to re-size a div with the class .pane-documentation-tree-menu. And I've achieved this, but only with a fixed height, if I try to add a <strong>maxHeight</strong> it doesn't work.</p>
  
  <p>Here's the code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  $(document).ready(function () {
      $('.pane-documentation-tree-menu').height(($(window).height() - 150 + "px"));
      $(window).resize(function () {
        $('.pane-documentation-tree-menu').height(($(window).height() - 150 + "px"));
      });
    });</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Background:</strong>
  I was looking for a solution to this problem and encountered this post here <a href="https://stackoverflow.com/questions/4931700/jquery-problem-with-height-and-resize">Jquery problem with height() and resize()</a> and it worked, but when I tried to add maxHeight it stoped working.</p>