I came across this article: Add/remove class with jquery based on vertical scroll? However, I am struggling to implement it for multiple divs, each with their own unique classes that require adding and removing 1 class at different distances from the top. Here is what I aim to achieve:
<div class="div-01">Add 1 class and remove 1 class when user scrolls down 500px from the top, and reverse the process when scrolling up.</div>
<div class="div-02">Add 1 class and remove 1 class when user scrolls down 1000px from the top, and reverse the process when scrolling up.</div>
<div class="div-03">Add 1 class and remove 1 class when user scrolls down 1500px from the top, and reverse the process when scrolling up.</div>