Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

window scroll up

// window scroll up and add a class for sticky menu
$(window).scroll(function () {
		if ($(this).scrollTop() > 650) {
			$('nav').addClass('sticky');
		} else {
			$('nav').removeClass('sticky');
		}
	});
 
PREVIOUS NEXT
Tagged: #window #scroll
ADD COMMENT
Topic
Name
8+6 =