{"id":11017804,"date":"2018-12-21T19:11:08","date_gmt":"2018-12-21T19:11:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/feature-request-infinity-scroll\/"},"modified":"2018-12-21T19:12:25","modified_gmt":"2018-12-21T19:12:25","slug":"feature-request-infinity-scroll","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/feature-request-infinity-scroll\/","title":{"rendered":"Feature Request &#8211; Infinity Scroll"},"content":{"rendered":"<p>I played with this some but didn&#8217;t have much luck. I think it would be a great feature though. This is what I tried:<\/p>\n<pre><code>\njQuery(document).on(&#039;scroll&#039;, function() {\n\t\t\t\n\tvar distanceFromBottom = Math.floor(jQuery(document).height() - jQuery(document).scrollTop() - jQuery(window).height());\n\tvar canbeloaded = false;\n\t\n\tif (jQuery(&#039;.load_more&#039;).is(&#039;:visible&#039;)) {\n\t\tcanbeloaded = true;\n\t}\n\n    if(distanceFromBottom &lt; 200 &amp;&amp; canbeloaded == true) {\n        \/\/ Prevent Load More from triggeirng early\n        jQuery(&#039;#acs_search_results_container .load_more&#039;).trigger( &#039;click&#039; );\n    }\n});\n<\/code><\/pre>\n<p>But I kept getting duplicate results. Thanks!!<\/p>\n","protected":false},"template":"","class_list":["post-11017804","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11017804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11017804\/revisions"}],"predecessor-version":[{"id":11017813,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11017804\/revisions\/11017813"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11017804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}