You would need a method that tested whether an element was fully within the bounds of the page. There are plugins that do this such as Remy Sharp's Element in-view Event Plugin or this by Digital Fusion but essentially you just need to test if an element is fully in view and add a class to it.
All relatively simple (although I confess to have not tested this x-browser so YMMV):
function testInView($el){
var wTop = $(window).scrollTop();
var wBot = wTop + $(window).height();
var eTop = $el.offset().top;
var eBot = eTop + $el.height();
return ((eBot <= wBot) && (eTop >= wTop));
}
function setInView(){
$("div").each(function(){//testing EVERY div (you might want to be more specific in your implementation)
var $zis = $(this);
$zis.removeClass("inview");
if(testInView($zis)){
$zis.addClass("inview");
}
});
}
$(document).scroll(function(){
setInView();
});
$(document).resize(function(){
setInView();
});
$(document).ready(function(){
setInView();
});
Here's the jsFiddle