jquery else and if statements help on scroller position
<p>I wanted to add an active class depending on the scroll position thankful I found this that had already been posted:</p>

<p><a href="http://stackoverflow.com/questions/2703086/jquery-add-css-class-to-menu-item-based-on-browser-scroller-position">jQuery : add css class to menu item based on browser scroller position</a></p>

<p>I have an extra navigation item to this tutorial, and do not know how to arrange the if, else if and else statements. </p>

<pre><code>$(window).scroll(function() {    
// find the li with class 'active' and remove it
$("#navigation li.active").removeClass("active");
// get the amount the window has scrolled
var scroll = $(window).scrollTop();
// add the 'active' class to the correct li based on the scroll amount
if (scroll &lt;= 500) {
    $("#nav-welcome").addClass("active");
}
else if (scroll &lt;= 1000) {
    $("#nav-about").addClass("active-purple");
}
else if (scroll &lt;= 1500) {
    $("#nav-portfolio").addClass("active");
}
else {
    $("#nav-contact").addClass("active-purple");
}
});
</code></pre>

<p>I'm getting two active classes where I've used the two else ifs.</p>

<p>Many thanks in advance.</p>
