Scroll to next class
<p>How do I make this scroll to the next class?</p>

<pre><code>var $root = $('html, body');
$('a.scroll-to-next-nav').click(function(){
    $root.animate({
        scrollTop: $( $(this).closest('.header-icons').nextAll('.header-icons') ).offset().top
    }, 500);
    return false;
});

&lt;div class="header-icons"&gt;&lt;a href="#" class="scroll-to-next-nav" title="Go to next section"&gt;Go to next section&lt;/a&gt;&lt;/div&gt;


&lt;div class="header-icons"&gt;&lt;a href="#" class="scroll-to-next-nav" title="Go to next section"&gt;Go to next section&lt;/a&gt;&lt;/div&gt;
&lt;div class="header-icons"&gt;&lt;a href="#" class="scroll-to-next-nav" title="Go to next section"&gt;Go to next section&lt;/a&gt;&lt;/div&gt;
</code></pre>
