Opacity based on scroll position
<p>The following code, will make the "Go to top" button fade in when the scrollTop() is over 400px, that works fine, but i haven't found a way to make it fade out when i go back to the top.</p>

<pre><code>$("#gototop").css("opacity", "0");
$(window).bind('scroll', function(){
    if($(this).scrollTop() &gt; 400) {
        $("#gototop").animate({
            opacity: 100,
        }, 3400);
    }
});
</code></pre>

<p>An <strong>else</strong> after the <strong>if</strong> didn't help, i tried different options with my non-ninja skills but none worked. Any ideas on how to make it fade out when the scroll is back at the top?</p>

<p>Thanks.</p>
