Jquery code for one page portfolio
<p>I am using following jquery code for my one page portfolio</p>

<pre><code>&lt;script&gt;
$(document).ready(function(){
    $('nav ul li a').click(function(){
        var el = $(this).attr('href');
        var elWrapped = $(el);
        scrollToDiv(elWrapped,140);
        return false;

    });

    function scrollToDiv(element,navheight){
          var offset = element.offset();
          var offsetTop = offset.top;
          var totalScroll = offsetTop-navheight;
          $('body,html').animate({
            scrollTop: totalScroll
        }, 650);
    }
});
&lt;/script&gt;
</code></pre>

<p><a href="http://www.hettzdesigns.com" rel="nofollow">link</a></p>

<p>but when page loads it directly goes to contact section of site instead of index section.</p>

<p>Can anyone tell where it is going wrong.</p>
