hide pages when current page is first or last page