Skip to content

Instantly share code, notes, and snippets.

View sneycampos's full-sized avatar

Silvio Ney sneycampos

  • Portugal
  • 22:30 (UTC +01:00)
View GitHub Profile
@sneycampos
sneycampos / infinitescroll.js
Created May 1, 2019 13:06 — forked from amitavroy/infinitescroll.js
This code is used to generate an infinite scroll. It appends the new data to the container. Need to work on providing an animation when the data is being fetched.
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
// calling the function to get the ajax data
loadMore();
}
});
function loadMore() {
$.ajax({
url: base_url + "/infscroll/get_inf_scroll_ajax",