[text] scroll fix

Viewer

copyrawdownloadembedprintName: scroll fix
  1. var last_y_pos = 0;
  2. var product_iteration = 1;
  3. overlay.find(".hr-results").on('scroll', ui_utility.throttle(function() {
  4.         if (closed) {
  5.                 return;
  6.     }
  7.     var current_y_pos = overlay.find(".hr-results").get(0).scrollTop;
  8.     storage.put("y_pos", overlay.find(".hr-results").get(0).scrollTop);
  9.     if (current_y_pos > last_y_pos) {
  10.         console.log(overlay.get(0).scrollHeight, overlay.find(".hr-results").get(0).scrollTop, overlay.get(0).scrollHeight, product_iteration);
  11.         if ((overlay.find(".hr-results").get(0).scrollTop > (overlay.get(0).scrollHeight * product_iteration)) && searcher.search_term && searcher.search_term.length) {
  12.             load_more_results(true);
  13.             product_iteration ++;
  14.         }
  15.     }
  16.     last_y_pos = current_y_pos;
  17. }, 200));

Editor

You can edit this paste and save as new:


File Description
  • scroll fix
  • Paste Code
  • 21 Sep-2021
  • 789 Bytes
You can Share it: