diff --git a/jquery-patterns/window-scroll-event.html b/jquery-patterns/window-scroll-event.html index 2f72627..4dd3c25 100644 --- a/jquery-patterns/window-scroll-event.html +++ b/jquery-patterns/window-scroll-event.html @@ -33,6 +33,28 @@ // reference // http://ejohn.org/blog/learning-from-twitter/ + + +// preferred v2, timeout instead of intervall - no unnecessary ticks +var scrollTimeout; // global for any pending scrollTimeout +var outerPane = $details.find(".details-pane-outer"), + +$(window).scroll(function() { + if (scrollTimeout) { + // clear the timeout, if one is pending + clearTimeout(scrollTimeout); + scrollTimeout = null; + } + scrollTimeout = setTimeout(scrollHandler,250); +}); + +scrollHandler = function() { + // Check your page position and then + // Load in more results + // outerPane.html(); +}; + + \ No newline at end of file