Follow these steps to fix the header at the top:
<script type="text/javascript">
window.onscroll = scroll1;
window.addEventListener("scroll", scroll1);
function scroll1() {
var scroll = window.pageYOffset;// to get the scroll amount of page
if (scroll > 27) {
document.getElementById("main-header").style.position = "fixed";
document.getElementById("main-header").style.top = "0px";
document.getElementById("main-header").style.right = "0px";
document.getElementById("main-header").style.left = "0px";
document.getElementById("main-header").style.zIndex = "25";
document.getElementById("nav-header").style.position = "fixed";
document.getElementById("nav-header").style.width = "100%";
document.getElementById("nav-header").style.top = "57px";
document.getElementById("nav-header").style.zIndex = "99";
}
else {
document.getElementById("main-header").style.position = "initial";
document.getElementById("nav-header").style.position = "initial";
document.getElementById("main-header").style.position = "static";
document.getElementById("nav-header").style.position = "static";
document.getElementById("main-header").style.top = "0px";
document.getElementById("main-header").style.right = "0px";
document.getElementById("main-header").style.left = "0px";
document.getElementById("nav-header").style.display = "block";
}
}
</script>
6. Save the changes and review the changes.