Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.
Im implementing infinite scrolling,i want the pages to be loaded before scroll reaches the end of page,like 50 pixels remaining to end.
i know i can do something like below,but its not working.
how should i do that?

C#
$(window).scroll(function(){
        if  ($(window).scrollTop() == $(document).height() - $(window).height()-50){
           lastPostFunc();
        }
});
Posted
Updated 22-Jul-12 0:32am
v2

1 solution

 
Share this answer
 
v3
Comments
firstfox 22-Jul-12 6:50am    
thank you.
i had checked these out before Smile | :)
still not working :(
woutercx 22-Jul-12 7:52am    
But are you adding content to the page then dynamically (with jquery)? If the browser doesn't have extra content that takes vertical space, it won't scroll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900