Answers for "infinite scroll javascript"

1

jquery infinite scroll

$(window).scroll(function () {
    // End of the document reached?
    if ($(document).height() - $(this).height() == $(this).scrollTop()) {
        $.ajax({
            type: "POST",
            url: "index.aspx/GetData",
            contentType: "application/json; charset=utf-8",
            data: '',
            dataType: "json",
            success: function (msg) {
                if (msg.d) {
                    $(".container").append(msg.d);
                }
            },
            error: function (req, status, error) {
                alert("Error try again");
            }
        });
    }
});
Posted by: Guest on June-17-2020
0

infinite scroll javascript

<div class="article-feed">
  <!-- .articles will be added to .article-feed -->
  <article class="article">...</article>
  <article class="article">...</article>
  ...
</div>

<!-- status elements -->
<div class="scroller-status">
  <div class="infinite-scroll-request loader-ellips">
    ...
  </div>
  <p class="infinite-scroll-last">End of content</p>
  <p class="infinite-scroll-error">No more pages to load</p>
</div>

<!-- pagination has path -->
<p class="pagination">
  <a class="pagination__next" href="page2.html">Next page</a>
</p>
Posted by: Guest on December-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language