Well the thing is really simple, I'm a newbi on Js and know almost nothing, the thing is that I want to change a navbar's style but I just can do it when it reaches a specific amount of pixels, I would like to make it change when it reaches the next div id of the page, this is the code:
$(window).scroll(function() {    
  var scroll = $(window).scrollTop();
  if (scroll >= 500) {
    $(".fondoa").addClass("fondoazul");
  } else {
    $(".fondoa").removeClass("fondoazul");
  }
});
Thank you so much for your help