Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

scroll for sticky

// 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: #scroll #sticky
ADD COMMENT
Topic
Name
9+4 =