Javascript implementation of scroll snapping.