これは非常に良い答えですが、これはあなたが言及した Viewport プラグインの修正版です。
(function($) {
$.belowthefold = function(lookIn, elements, settings) {
var fold = $(lookIn).height() + $(lookIn).scrollTop();
return $(elements).filter(function(){
return fold <= $(this).offset().top - settings.threshold;
});
};
$.abovethetop = function(lookIn, elements, settings) {
var top = $(lookIn).scrollTop();
return $(elements).filter(function(){
return top >= $(this).offset().top + $(this).height() - settings.threshold;
});
};
$.rightofscreen = function(lookIn, elements, settings) {
var fold = $(lookIn).width() + $(lookIn).scrollLeft();
return $(elements).filter(function(){
return fold <= $(this).offset().left - settings.threshold;
});
};
$.leftofscreen = function(lookIn, elements, settings) {
var left = $(lookIn).scrollLeft();
return $(elements).filter(function(){
return left >= $(this).offset().left + $(this).width() - settings.threshold;
});
};
})(jQuery);
次のような HTML を使用します。
<div id="lookInMe">
<div class="peek"></div>
<div class="peek"></div>
[ ... ]
</div>
次のように呼び出します。
$.belowthefold("#lookInMe", ".peek", {threshold : 0}).text("Below");
$.abovethetop("#lookInMe", ".peek", {threshold : 0}).text("Above");
$.leftofscreen("#lookInMe", ".peek", {threshold : 0}).text("Left");
$.rightofscreen("#lookInMe", ".peek", {threshold : 0}).text("Right");
http://jsfiddle.net/daCrosby/vhF7x/1/