[javascript] How to check if an element is off-screen