set trigger distance and scroll listener