vvo / in-viewport

Get a callback when any element becomes visible in a viewport (body or custom viewport)
MIT License
276 stars 24 forks source link

If elt doesn't exist the console returns multiple errors #25

Closed paulincai closed 7 years ago

paulincai commented 7 years ago

Example error: Uncaught TypeError: Cannot read property 'offsetWidth' of undefined. I am not sure what is the exact intention there and if !elt should be covered as well but at least it looks that we need to back up on a situation when elt is undefined.