pure javascript implementation that makes an element stick to the top when scrolling down the page