title: How to use maximum for JS math in CSS-related function
body: <p>I've written a function below that allows the user to control the size of certain objects based on a scroll position. The issue is that I don't know how to force the math to stop a minimum or maximum.</p>
  
  <p>In this case, I would like the header width to decrease until it's 25% wide.</p>
  
  <pre><code>function EasyPeasyParallax() {
      var scrollPos = $(document).scrollTop();
      var currentSize = 100
      $('.header').css({ 'width': (currentSize - Math.min(scrollPos/1.5,2000)) + '%' });
  };
  
  $(document).ready(function() {
      $('body').bind('mousewheel', EasyPeasyParallax);
  });
  </code></pre>
  
  <p>I've tried <code>Math.max()</code>, but ultimately don't really know how to make this happen.</p>
  
  <p>Any help?</p>
  
  <p>Codepen here: <a href="http://codepen.io/bsley/pen/gGyhm" rel="nofollow">http://codepen.io/bsley/pen/gGyhm</a></p>