Created
October 17, 2019 14:36
-
-
Save valivarthy/dad008dd7193d59a660996569df21a05 to your computer and use it in GitHub Desktop.
Solving jumping Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function headerSolver(){ | |
var scrollPosition = document.documentElement.scrollTop; | |
if (scrollPosition > 75) { | |
$('header').css('position', 'fixed'); | |
} else { | |
$('header').css('position', 'relative'); | |
} | |
} | |
window.onscroll = function() {headerSolver()}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment