jquery, window.scroll, position a banner
<p>I want to position a banner while scrolling:</p>

<p>The code is </p>

<pre><code>$(window).scroll(function(){
    offset = $(window).scrollTop()+80;
    var h = $(window).height();

    if(offset &lt; 80 &amp;&amp; offset &lt; (h-800))
    {
        offset = 80;
    }

    $('#sidebar1').animate({top:offset}, 450);
});
</code></pre>

<p>The problem is the <strong>offset</strong> is dynamic and it changes while scrolling down, the banner goes beyond the window and while scrolling down it slides up slowly. I want a constant animation while scrolling up and down. </p>

<p>Is there a attribute like bottom instead of top, or is there an event other than scroll to achieve a constant scroll?</p>
