select element certain distance from top of window
<p>It's simple, though I'm having trouble. Multiple rows of an element with the same class (<code>.proj</code>) on the page. Each takes 100% width. I want the <code>div.proj</code> that is within 200 pixels of the top of the window to have a class <code>.focused</code>, and otherwise, if it isn't near the top, to have the class <code>.default</code>. The problem I'm having is singling out the one element.</p>

<p>This is where I am at this point, but it finds all elements <code>.proj</code> instead of just the one that I'm looking for. This is what I have so far, which isn't really working at all at this point.</p>

<pre><code>$(document).scroll(function(){
    var proj = $('.proj'),
        top = proj.offset().top - $(document).scrollTop();
    if (top &lt; 200 &amp;&amp; !proj.is('.default')){
        $(proj).removeClass('focused').addClass('default');
    }
    if (top &gt; 200 &amp;&amp; proj.is('.default')){
        $(proj).removeClass('default').addclass('focused');
    }  
});
</code></pre>
