How do I wait for "animated scroll to id" to complete before focusing on first form field?
<p>So, I have a link at the bottom of website. When it is clicked, it scrolls to a form at the top of the page with the animated style. And as it arrives at top of page, it focuses on the first field in form.</p>

<p>Currently, this is my code:</p>

<pre><code>$(document).ready(function() {          
    $('#goto-show-form').click(function() {
        $('html, body').animate({scrollTop: $("#show-form").offset().top}, '500');
        $('#first-field').focus();
        return false;
    });
});
</code></pre>

<p>What happens is it begins scrolling, then focuses to form field while still in process of scrolling, then returns to last position in scrolling process and continues scrolling up. Instead of being smooth, you can see it cuts back and forth.</p>

<p>How can I tell jquery to wait until scrolling is complete before focusing to the form field?</p>

<p>Here is the website: <a href="http://bit.ly/dfjvmT" rel="nofollow">http://bit.ly/dfjvmT</a> (The link that starts scroll is "Send us your resume" at the bottom.)</p>

<p>Thanks.</p>
