This is my code:
jQuery(document).ready(function($){
$(window).on('scroll', function(){
if($(window).scrollTop() >= $('#element').offset().top){
$('.menu').addClass('addclass');
}
});
});
It adds addclass to the menu when reaching id = "element" at the top of the page and scrolling further to the bottom.
But how to remove addclass when id = "element" is again below the top of the pages.