you could use this function to check whether an element is visible (e.g. a element at the bottom of the page):
function isScrolledIntoView(elem)
{
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;
var elemBottom = elemTop + $(elem).height();
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));
}
I implemented an endless scrolling effect (like in facebook) with it.
you can check each time, the user is scrolling the window:
function checkAndLoad(){
if(isScrolledIntoView($('#footer'))){
triggerSomething(); //
}
}
$(document).ready(function(){
checkAndLoad();
$(window).scroll(function(){
checkAndLoad();
});
});