Answers for "css sticky on scroll"

CSS
0

fix scroll css position sticky

html {
  scroll-padding-top: 200px; /* your overlapping header/div height */
}
Posted by: Guest on August-04-2021
0

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');
		}
	});
Posted by: Guest on January-25-2022

Browse Popular Code Answers by Language