I'm trying to change the color of the background whenever i enter into a new section. I think this is the direction i should follow, but I'm really lost at this point, cause i don't know if it is even posible to make the BG change in the class instead of the height pixels. The first part is what i want to make, and the second one is the one i have now and i want to change. Thank you so much <33
$(function() {
$(window).scroll(function() {
if ($(this).scrollTop() > ('parte2')) {
$('body, html').addClass('changeColor');
} else {
$('body, html').removeClass('changeColor');
}
if ($(this).scrollTop() > 6450) {
$('body, html').addClass('changeColor2');
} else {
$('body, html').removeClass('changeColor2');
}