Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Guys I mean when I mouse scroll down I want to get datas like in Twitter,Facebook. what way should i follow? what kind of research should i do?

What I have tried:

I didn't do anything yet. I dotn know how do I search about this.
Posted
Updated 22-May-20 0:17am

1 solution

For web content, the term you're looking for is "infinite scroll".

In its simplest form, you use Javascript to detect when the user scrolls near to the bottom of your page, and then make an AJAX call to load more content.

For example, using jQuery:
JavaScript
$(window).on("scroll", function(){
    var $w = $(window);
    var $d = $(document);
    var padding = 50; // Load more if we're within 50 pixels of the bottom

    if ($w.scrollTop() >= $d.height() - $w.height() - padding) {
        loadMoreData();
    }
});
 
Share this answer
 
Comments
Maciej Los 22-May-20 8:55am    
5ed!
Member 14769019 22-May-20 16:28pm    
I open new question. Can u check please? I shared my codes.

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