Homepage/js/main.js
2018-08-01 12:27:55 +02:00

11 lines
351 B
JavaScript

$(document).ready(function() {
$(document).on('scroll', {passive: true}, function() {
/* On scroll check if scrolled beyond 100% */
var header = document.getElementById("pgHeader");
if (window.pageYOffset >= $(window).height()) {
header.classList.add("sticky");
} else {
header.classList.remove("sticky");
}
});
});