My goal is to make a fixed div appear at the top of a page once someone scrolls a certain amount of pixels down the page. Basically once the header section is out of view,
window.addEventListener("scroll",function() { if(window.scrollY > 500) { $('.fixedDiv').slideDown(); } else { $('.fixedDiv').slideUp(); } },false);