title: How to adjust div max-height on browser open and reinitialize
body: <p>Okay I have a div class "content"  and whenever the browser resizes to 800px in height the content div resizes its max-height to 500px.  The problem I am having is if the browser opens with a height of 800px then there is no scrollbar for the div unless I refresh the browser.</p>
  
  <p>The code I have:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(window).on('resize', function(){
  if($(this).height() &lt;= 800){
      $('.content').css('max-height', '500px'); //set max height
  }else{
      $('.content').css('max-height', ''); //delete attribute
  }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Also I am using jScrollPane and it works fine if I set the max-height in the css but if I use the code above instead a regular scrollbar is used.  Any help on either would be appreciated.</p>