title: jquery how to offset scroll position
body: <p>I have the following code that scrolls to a certain element:</p>
  
  <pre><code>$('html, body').animate({
           scrollTop: $("#maincontent").offset().top
       }, 400);
  </code></pre>
  
  <p>However, I have a fixed navbar at the top and so would like to be able to offset this. How can I offset it by a number of pixels?</p>