Permalink
Browse files

Making ceaseFire work the way I would expect it to, called on each sc…

…roll, ending the scroll if ceaseFire returns true
  • Loading branch information...
1 parent 97ced58 commit 1a7682a7388cfc8f90d6f08c43a841acb9d32ea8 @RussTheAerialist RussTheAerialist committed Sep 24, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 js/jquery.endless-scroll.js
@@ -78,6 +78,11 @@
if (firing === true)
{
$(this).scroll(function() {
+ if (options.ceaseFire.apply(this) === true)
+ {
+ firing = false;
+ return; // Scroll will still get called, but nothing will happen
+ }
if (this == document) {
var is_scrollable = $(document).height() - $(window).height() <= $(window).scrollTop() + options.bottomPixels;
} else {
@@ -129,4 +134,4 @@
}
};
-})(jQuery);
+})(jQuery);

0 comments on commit 1a7682a

Please sign in to comment.