Skip to content

Instantly share code, notes, and snippets.

@valivarthy
valivarthy / header-solver.js
Created October 17, 2019 14:36
Solving jumping Header
function headerSolver(){
var scrollPosition = document.documentElement.scrollTop;
if (scrollPosition > 75) {
$('header').css('position', 'fixed');
} else {
$('header').css('position', 'relative');
}
}
window.onscroll = function() {headerSolver()};