checks to see if an element is visible on viewpport. Borrowed from SAMATDF!