The title pretty much speaks for itself. So how would I go about doing that using jQuery or javascript?
I know to tell if the scroll bar has reached the end of a window, it would be something like this.
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
alert('you have reached the bottom');
}
});
So how would I tell if it has reached a specific section then give the alert?
thanks.
Granted not a difficult problem to solve, but check out jQuery Waypoints… a very nice plugin to meet your requirements.
A quick example from their site:
Elegant and easy to read too, and the plugin is very small, < 4kb.