- var element = document.getElementById('portfolio-content-nav') + window.pageYOffset + 'px';
+ var element = document.getElementById('portfolio-content-nav');
window.addEventListener('scroll', function () {
- if (element > 100) {
+ if (window.scrollY > 100) {
element.classList.add("shadow");
} else {
element.classList.remove("shadow");
}
});