jQuery smooth scroll, do only if anchor link is an id
<p>I have written a smooth scroll function using jQuery.
But there is a problem, </p>

<p>if anchor has only hash in href, then it return undefined error.
like: </p>

<p><code>&lt;a href="#" title="something"&gt;Link&lt;/a&gt;</code></p>

<p>Please tell how to run my function only if anchor link is an ID and not if only hash.</p>

<p><strong>Here is my function:</strong></p>

<p>//smooth scroll</p>

<pre><code>jQuery('a[href^="#"]').click(function (e) {    
        e.preventDefault();
        var target = this.hash;
        jQuery('html, body').animate({ 
                  scrollTop: (jQuery(target).offset().top) - 60 
                }, 1000);    
});
</code></pre>
