user1537415
user1537415

Reputation:

Load new content from database when user scrolls to the bottom using jquery and php?

I'm trying to load new content to my page from database when user scrolls to the bottom of a page. How this would be achieved? I've tought of jquery's ajax and php combined, but I have no idea.

Upvotes: 0

Views: 1578

Answers (1)

Mujtaba Haider
Mujtaba Haider

Reputation: 1650

No need for any plugin i gues. jQuery code for this

$(window).scroll(function () { 
   if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) {
      //Add jQuery ajax code here to fetch data from server/database and append more elements etc
   }
});

Upvotes: 1

Related Questions