Q:

Given a Div with a set height and overflow set to scroll - How to determine if an item is above the fold?

Is this possible? Given a div of say max-height 400 with overflow set to scroll. If the inner contents have a height of 1000, how can I determine if an item in the inner div is visible or below/above the overflow?

A:

jQuery( ".content" ).each( function(){
    this.innerHTML = this.offsetTop > this.parentNode.offsetHeight ? "below" : "above";
});

jsfiddle: http://jsfiddle.net/4E3DH/3/
position:relative; (or any non static position) for the container is a must.

