Permalink
Browse files

Bumped version to 1.4.4 - The AJAX loader should be removed when ther…

…e's no more results to load.
  • Loading branch information...
1 parent b3b48d2 commit a23c51fcdd963b5fee5ae4314be0d26968181ccf @fredwu fredwu committed Jun 28, 2011
Showing with 17 additions and 13 deletions.
  1. +8 −4 README.md
  2. +2 −3 index.html
  3. +7 −6 js/jquery.endless-scroll.js
View
@@ -1,6 +1,6 @@
# Endless Scroll
-If you dont already know, [endless scroll](http://www.google.com/search?q=endless+scroll) (or infinite scrolling) is a popular technique among web 2.0 sites such as [Google Reader](http://reader.google.com/) and [Live Image Search](http://www.live.com/?scope=images), where instead of paging through items using the traditional pagination technique, the page just keeps loading with new items attached to the end.
+If you don't already know, [endless scroll](http://www.google.com/search?q=endless+scroll) (or infinite scrolling) is a popular technique among web 2.0 sites such as [Google Reader](http://reader.google.com/) and [Live Image Search](http://www.live.com/?scope=images), where instead of paging through items using the traditional pagination technique, the page just keeps loading with new items attached to the end.
I have developed a jQuery plugin to easily achieve this.
@@ -16,7 +16,7 @@ There are a few options to customise the behaviour of this plugin:
- _resetCounter_ (function) - resets the fire sequence counter if the function returns true, this function could also perform hook actions since it is applied at the start of the event
- _ceaseFire_ (function) - stops the event (no more endless scrolling) if the function returns true
-In a typical scenario, you wont be using the `data` option, but rather the `callback` option. You may use it to trigger an AJAX call and updates/inserts your page content.
+In a typical scenario, you won't be using the `data` option, but rather the `callback` option. You may use it to trigger an AJAX call and updates/inserts your page content.
## Usage
@@ -40,17 +40,21 @@ $(document).endlessScroll({
## Changelog
+v1.4.4 [2011-06-28]
+
+- The AJAX loader should be removed when there's no more results to load.
+
v1.4.3 [2011-06-28]
- The `data` option now accepts a fireSequence argument too.
v1.4.2 [2011-01-08]
-- Fixed a bug where calling the script on $(document) would fail.
+- Fixed a bug where calling the script on `$(document)` would fail.
v1.4.1 [2010-06-18]
-- Fixed a bug where the callback fires when the inner wrap hasnt been created.
+- Fixed a bug where the callback fires when the inner wrap hasn't been created.
v1.4 [2010-06-18]
View
@@ -18,9 +18,8 @@
<script type="text/javascript" charset="utf-8">
$(function() {
$('ul#list').endlessScroll({
- bottomPixels: 500,
- fireDelay: 10,
- insertAfter: "ul#list li:last",
+ fireOnce: false,
+ insertAfter: "ul#list div:last",
data: function(i) {
console.log(i)
return '<li>' + i + '</li>'
@@ -1,7 +1,7 @@
/**
* Endless Scroll plugin for jQuery
*
- * v1.4.3
+ * v1.4.4
*
* Copyright (c) 2008 Fred Wu
*
@@ -59,9 +59,9 @@
loader: "<br />Loading...<br />",
data: "",
insertAfter: "div:last",
- resetCounter: function(){ return false; },
- callback: function(){ return true; },
- ceaseFire: function(){ return false; }
+ resetCounter: function() { return false; },
+ callback: function() { return true; },
+ ceaseFire: function() { return false; }
};
var options = $.extend(defaults, options);
@@ -102,7 +102,6 @@
data = typeof options.data == 'function' ? options.data.apply(this, [fireSequence]) : options.data;
if (data !== false)
{
- $("div#endless_scroll_loader").remove();
$(options.insertAfter).after("<div id=\"endless_scroll_data\">" + data + "</div>");
$("div#endless_scroll_data").hide().fadeIn();
$("div#endless_scroll_data").removeAttr("id");
@@ -113,7 +112,7 @@
{
// slight delay for preventing event firing twice
$("body").after("<div id=\"endless_scroll_marker\"></div>");
- $("div#endless_scroll_marker").fadeTo(options.fireDelay, 1, function(){
+ $("div#endless_scroll_marker").fadeTo(options.fireDelay, 1, function() {
$(this).remove();
fired = false;
});
@@ -123,6 +122,8 @@
fired = false;
}
}
+
+ $("div#endless_scroll_loader").remove();
}
});
}

0 comments on commit a23c51f

Please sign in to comment.