logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

infinite_scroll.js (725B)


  1. $(document).ready(function() {
  2. var win = $(window);
  3. win.scroll(function() {
  4. if ($(document).height() - win.height() == win.scrollTop()) {
  5. var formData = $('#pagination form:last').serialize();
  6. if (formData) {
  7. $('#pagination').html('<div class="loading-spinner"></div>');
  8. $.post('./', formData, function (data) {
  9. var body = $(data);
  10. $('#pagination').remove();
  11. $('#main_results').append('<hr/>');
  12. $('#main_results').append(body.find('.result'));
  13. $('#main_results').append(body.find('#pagination'));
  14. });
  15. }
  16. }
  17. });
  18. });