make jquery progress bar on top of article
<p><a href="http://www.newrepublic.com/article/112477/walter-kirns-oscars-misadventure" rel="nofollow">http://www.newrepublic.com/article/112477/walter-kirns-oscars-misadventure</a></p>

<p>New republic have a really cool bar that fills up as you're scrolling an article.</p>

<p>I know how to add classes like -</p>

<pre><code>$(document).scroll(function() {    
    var scroll = $(window).scrollTop();

    if (scroll &gt;= 50) {
        $(".logo").addClass("smalllogo");
    } else {
        $(".logo").removeClass("smalllogo");
    }
});
</code></pre>

<p>But how would one make a certain div the variable and then animate a scroll bar depending on how much of that div has been scrolled?
Or am I thinking about this wrong?</p>

<p>How does one make a progress bar that makes a div 0% - 100% width based on the scroll position of a certain div?</p>
