As of February 2013, speaking of all that brand new, top-notch APIs (including experimental and even crazy ones), can you provide how one should detect whether specific DOM node is currently in viewport or not.
Cross-browserness is a plus. Flexibility and and universalism are even greater pluses.
So, basically I need something like is_in_viewport(dom_node) which returns Boolean.
Some Clarification. Let us by visibility mean that at least a single pixel of the element is physically visible in the viewport (which is not necessarily window).
By classic approaches I mean:
- measuring element's dimension and position using such properties as offsetTop, offsetLeft etc.
- using getBoundingClientRect
So, to put it simple, I'm looking for some kind of API that hides from me the level of abstraction which deals with direct measurements and subsequent computations.