isScrolledIntoView method rewritten