I’m working on an infinite scroll implementation using IndexedDB. I am at the part where I need to determine the last element visible on the page.
How can I determine whether an element on the page is within the user’s current scroll pane? If possible, I would prefer native JS over libraries or plugins for jQuery.
I understand the reluctance to use jQuery plugins, but when there is one that seems to do exactly what you’re looking for – http://www.appelsiini.net/projects/viewport – that’s surely the easiest way to go.