fix position bug when base element not in the viewport(document scroll)