nickberens360
2/11/2015 - 6:26 PM

jQuery nav scroll position distance

jQuery nav scroll position distance

jQuery( document ).ready(function( $ ) {
	
	$(window).scroll(function() {
			var nav = $('.masthead');
			var top = 200;
			if ($(window).scrollTop() >= top) {
				
					nav.addClass('masthead-is-scrolled');
	
			} else {
					nav.removeClass('masthead-is-scrolled');
			}
	});
	
});