JavaScript   

Pure JavaScript functions to detect scroll height for sticky header

let navbar = document.querySelector('.navbar');
let navChangePoint = 100;
function stickyNav() {
	if (window.scrollY >= navChangePoint) {
		navbar.classList.remove('transparent-header');
	} else {
		navbar.classList.add('transparent-header');
	}
}
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us