title: Load link centre jquery
body: <p>My questions is about a horizontal scrolling 1 page site. I used jQuery for the scrolling. When you click the link in the navigation menu you go to that section, but it appears completely on the right side of the screen.</p>
  
  <p>I'm very new to jQuery and I would like the linked sections in the centre of the screen. Does anyone now how to accomplish this? </p>
  
  <p>Here is the code I am using:</p>
  
  <pre><code>$(function() {
  $('a[href*=#]:not([href=#])').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &amp;&amp; location.hostname == this.hostname) {
        var target = $(this.hash);
        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
        if (target.length) {
          $('html,body').animate({
            scrollLeft: target.offset().left
          }, 1000);
                 return false;
        }
      }     
    });
  });
  </code></pre>