I'm trying to change a class based on how far from the top of the document the window is, and when it's greater then a certain value to make the switch, for some reason it's not happening, this is what I have so far:
$(window).scroll(function() {
if ($('html, body').offset.top > ($("#top_section").outerHeight(true) + $("#grid").outerHeight(true))) {
$(".nav_middle_text").removeClass("selected");
$(".nav_middle_text").addClass("notselected");
$("#about_link").removeClass("notselected");
$("#about_link").addClass("selected");
}
});