fix scroll position to top or bottom