well, on my website.. load previous posts is already configured BUT WHEN TRIGGERED WITH A CLICK ON PARTICULAR LINK...

now, the requirement is to load the previous posts on scroll down (AS IN FACEBOOK AND TWITTER...)


this is the source of the link which when clicked loads previous posts

Code:
       <a id="more_<?php echo @$next_records?>" href="javascript: void(0)" class="more_records">
            <div id="bottomMoreLink">
                Dig More...
            </div>
        </a>
now as this code doesn't include a function name, there is a script which has got the same class as this one to handle the request.. which is as under..

Code:
<script type="text/javascript">
$('a.more_records').livequery("click", function(e)
{
SOME CUSTOM CODE TO LOAD POSTS..
});
</script>
now as per the requirement... i have two things to do..

1. Detect the user has scrolled down to the end of the page.

this can be done as follows...

Code:
<scrtip type="text/javascript">
$(window).scroll(function(){
    if  ($(window).scrollTop() == $(document).height() - $(window).height()){
      lastRow();
    }
});
</script>
2. trigger the thing that loads previous posts.. if the user has scrolled to the bottom of the page

THIS IS WHERE I AM LOOKING FOR SOME HELP, WHICH IS CURRENTLY BEING DONE BY A CLICK ..
am not able to figure out how to trigger the code in second block above..

please suggest something..