Skip to content

Instantly share code, notes, and snippets.

@paul-english
Created July 26, 2010 19:48
Show Gist options
  • Save paul-english/491124 to your computer and use it in GitHub Desktop.
Save paul-english/491124 to your computer and use it in GitHub Desktop.
{% wire id="more-results" action={moreresults result=result target="list-articles" template="_article_summary.tpl"} %}
<p style="display:none;"><a href="javascript:void(0);" id="more-results">More results...</a></p>
<script>
$(function() {
// PE - this is all a hack, anyone know a better way to do this?
var firedOnce = false;
$(document).scroll(function(e) {
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 200) {
if (!firedOnce) {
console.log("go!");
firedOnce = true;
$('#more-results').click();
setTimeout(function() { firedOnce = false; }, 2000);
}
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment