title: jQuery: Scroll to the center of the element
body: <p>I am working on a jQuery function that scrolls to the div on click. Right now it will scroll to the top, I was wondering if their was a way to make it scroll to the center of <code>$('.scrollit')</code> instead of top, or possibly a way to offset it by some pixel amount?</p>
  
  <pre><code>$(".playbox").on('click', function () {
      $('.scrollit').animate({
          scrollTop: $(this).offset().top
      }, 1000);
  </code></pre>