when scrolling viewport, select the right element in navigation