inViewport

returns whether an element is in the viewport area. the second parameter makes the function return true even for partially onscreen objects.