JS for transition while scrolling