Smooth Scrolling anchor with offset (jquery)
<p>Im using the following code to add smooth scrolling for anchors on my site.
Because i have a sticky header id like to offset this by say 200px </p>

<pre><code>$('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({
                scrollTop: target.offset().top
            }, 1000);
            return false;
        }
    }
});
</code></pre>