{"id":13831482,"url":"https://github.com/fredwu/jquery-endless-scroll","last_synced_at":"2025-04-04T08:05:28.523Z","repository":{"id":741592,"uuid":"392483","full_name":"fredwu/jquery-endless-scroll","owner":"fredwu","description":"Endless/infinite scrolling/pagination.","archived":false,"fork":false,"pushed_at":"2017-07-29T13:59:53.000Z","size":4122,"stargazers_count":838,"open_issues_count":28,"forks_count":174,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-03-28T07:04:03.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://fredwu.github.com/jquery-endless-scroll/","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredwu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-02T06:46:03.000Z","updated_at":"2025-01-28T12:11:04.000Z","dependencies_parsed_at":"2022-07-18T12:31:30.472Z","dependency_job_id":null,"html_url":"https://github.com/fredwu/jquery-endless-scroll","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fjquery-endless-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fjquery-endless-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fjquery-endless-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fjquery-endless-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredwu","download_url":"https://codeload.github.com/fredwu/jquery-endless-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247140187,"owners_count":20890382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T10:01:29.066Z","updated_at":"2025-04-04T08:05:28.505Z","avatar_url":"https://github.com/fredwu.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"# Endless Scroll [![endorse](http://api.coderwall.com/fredwu/endorsecount.png)](http://coderwall.com/fredwu)\n\n#### If you encounter problems with scrolling up, please use the old [1.6.0 release](https://github.com/fredwu/jquery-endless-scroll/zipball/1.6.0). The code base is currently being rewritten on the [2.0-rewrite branch](https://github.com/fredwu/jquery-endless-scroll/tree/2.0-rewrite).\n\nIf you don't already know, [endless scrolling](http://www.google.com/search?q=endless+scroll) (or infinite scrolling or pagination) is a popular technique amongst modern websites such as [Google Reader](http://reader.google.com/) and [Live Image Search](http://www.live.com/?scope=images), whereby instead of paging through items using traditional pagination links, the page just keeps loading with new items attached to the end.\n\nEndless Scroll not only helps you build highly customisable infinite scrolling effects, it also offers features not commonly seen. Such features include:\n\n- The ability to up-scroll and prepend content to the beginning of the page\n- The ability to limit the number of available 'pages', i.e. data truncation\n- And there are more exciting features in the works, including SEO-friendly URLs!\n\n## Configuration\n\nThere are a few options to customise the behaviour of this plugin:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cstrong\u003eOption\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epagesToKeep\u003c/td\u003e\n    \u003ctd\u003eInteger\u003c/td\u003e\n    \u003ctd\u003eThe number of 'pages' to keep before either end of the scrolling content are discarded, by default (value set to `null`) no content will be discarded.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003einflowPixels\u003c/td\u003e\n    \u003ctd\u003eInteger\u003c/td\u003e\n    \u003ctd\u003eThe number of pixels from the boundary of the element that triggers the event.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003efireOnce\u003c/td\u003e\n    \u003ctd\u003eBoolean\u003c/td\u003e\n    \u003ctd\u003eOnly fire once until the execution of the current event is completed.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003efireDelay\u003c/td\u003e\n    \u003ctd\u003eInteger\u003c/td\u003e\n    \u003ctd\u003eDelays the subsequent firing, in milliseconds, 0 or false to disable delay.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eloader\u003c/td\u003e\n    \u003ctd\u003eString\u003c/td\u003e\n    \u003ctd\u003eThe HTML to be displayed during loading.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent\u003c/td\u003e\n    \u003ctd\u003eString or Function\u003c/td\u003e\n    \u003ctd\u003ePlain HTML content to insert after each call, can be either a string or a function that returns a string, when passed as a function it accepts three arguments:\u003cul\u003e\u003cli\u003e\u003cem\u003efireSequence\u003c/em\u003e the number of times the event triggered during the current page session\u003c/li\u003e\u003cli\u003e\u003cem\u003epageSequence\u003c/em\u003e a positive or negative value that represents the scroll direction sequence\u003c/li\u003e\u003cli\u003e\u003cem\u003escrollDirection\u003c/em\u003e a string of either 'prev' or 'next'\u003c/li\u003e\u003c/ul\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003einsertBefore\u003c/td\u003e\n    \u003ctd\u003eString\u003c/td\u003e\n    \u003ctd\u003ejQuery selector syntax: where to put the loader as well as the plain HTML data.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003einsertAfter\u003c/td\u003e\n    \u003ctd\u003eString\u003c/td\u003e\n    \u003ctd\u003ejQuery selector syntax: where to put the loader as well as the plain HTML data.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eintervalFrequency\u003c/td\u003e\n    \u003ctd\u003eInteger\u003c/td\u003e\n    \u003ctd\u003eSet the frequency of the scroll event checking, the larger the frequency number, the less memory it consumes - but also the less sensitive the event trigger becomes.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eceaseFireOnEmpty\u003c/td\u003e\n    \u003ctd\u003eBoolean\u003c/td\u003e\n    \u003ctd\u003eCeases fire automatically when the content is empty, set it to `false` if you are using `callback` instead of `content` for loading content.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eresetCounter\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eResets 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.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecallback\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eCallback function, accepts three arguments:\u003cul\u003e\u003cli\u003e\u003cem\u003efireSequence\u003c/em\u003e the number of times the event triggered during the current page session\u003c/li\u003e\u003cli\u003e\u003cem\u003epageSequence\u003c/em\u003e a positive or negative value that represents the scroll direction sequence\u003c/li\u003e\u003cli\u003e\u003cem\u003escrollDirection\u003c/em\u003e a string of either 'prev' or 'next'\u003c/li\u003e\u003c/ul\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eceaseFire\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eStops the event (no more endless scrolling) if the function returns true, accepts three arguments:\u003cul\u003e\u003cli\u003e\u003cem\u003efireSequence\u003c/em\u003e the number of times the event triggered during the current page session\u003c/li\u003e\u003cli\u003e\u003cem\u003epageSequence\u003c/em\u003e a positive or negative value that represents the scroll direction sequence\u003c/li\u003e\u003cli\u003e\u003cem\u003escrollDirection\u003c/em\u003e a string of either 'prev' or 'next'\u003c/li\u003e\u003c/ul\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Usage\n\n``` js\n// using default options\n$(window).endlessScroll();\n// using some custom options\n$(\"#images\").endlessScroll({\n  fireOnce: false,\n  fireDelay: false,\n  loader: '\u003cdiv class=\"loading\"\u003e\u003cdiv\u003e',\n  callback: function(p){\n    alert(\"test\");\n  }\n});\n```\n\n### Custom Loader Styles\n\nYou may customise the look and feel of the loader by changing:\n\n- `.endless_scroll_loader` (class, for all Endless Scroll loaders);\n- Or `#endless_scroll_loader_\u003cscroller_dom_html_id\u003e` (id, for the specific loader).\n\n### Custom Style for the Most Recently Loaded Content\n\nThe most recently loaded content is wrapped in `#endless_scroll_content_current`.\n\n## Demo\n\n[Click here for a simple demo](http://fredwu.github.com/jquery-endless-scroll/).\n\n## CoffeeScript and JavaScript\n\nEndless Scroll, starting from v1.6.0 is written in [CoffeeScript](http://coffeescript.org/). To contribute and/or modify the source code, please edit `src/jquery.endless-scroll.coffee` and recompile the JavaScript. To include Endless Scroll in your webpage, please use the compiled `js/jquery.endless-scroll.js`.\n\nThe command for automatically compiling to JavaScript is:\n\n```bash\ncoffee -w -b -o js/ -c src/\n```\n\n## Browser Support\n\nAll modern browsers (Firefox, Chrome, Safari, Opera, IE7+) should be supported. Please [open an issue](https://github.com/fredwu/jquery-endless-scroll/issues) if Endless Scroll doesn't work on a particular browser.\n\n## Changelog\n\nv1.8.0 [2012-04-17]\n\n- Added `ceaseFireOnEmpty`.\n- Added `pagesToKeep`.\n- Fixed `$(window)` uses.\n\nv1.7.1 [2012-04-16]\n\n- Added `scrollDirection` to the callback arguments.\n- Fixed the demo.\n\nv1.7.0 [2012-04-16]\n\n- Endless Scroll now supports infinite up-scrolling!\n- Renamed `bottomPixels` option to `inflowPixels`.\n- Added `insertBefore` option.\n- Added `pageSequence` to the callback arguments.\n- Fixed the unreliable `#endless_scroll_content_current` wrapper.\n\nv1.6.0 [2012-04-15]\n\n- Refactored the code using CoffeeScript.\n- Renamed `data` option to `content`.\n- Tweaked the demo page.\n\nv1.5.1 [2012-03-08]\n\n- Added `fireSequence` argument to `ceaseFire`.\n- Added a `ceaseFire` example to the demo page.\n- Fixed `loader`.\n\nv1.5.0 [2012-03-08]\n\n- Added `intervalFrequency` option.\n- Endless Scroll should now consume less memory in most situations.\n\nv1.4.8 [2011-11-18]\n\n- Refactored default options merge to avert side effects.\n\nv1.4.7 [2011-11-08]\n\n- Compatibility fix for IE7 and IE8.\n\nv1.4.6 [2011-10-26]\n\n- Fixed an issue with inner_wrap and the first scroll event.\n\nv1.4.5 [2011-09-25]\n\n- `ceaseFire` now works as expected during a `scroll` event.\n\nv1.4.4 [2011-06-28]\n\n- The AJAX loader should be removed when there's no more results to load.\n\nv1.4.3 [2011-06-28]\n\n- The `data` option now accepts a fireSequence argument too.\n\nv1.4.2 [2011-01-08]\n\n- Fixed a bug where calling the script on `$(document)` would fail.\n\nv1.4.1 [2010-06-18]\n\n- Fixed a bug where the callback fires when the inner wrap hasn't been created.\n\nv1.4 [2010-06-18]\n\n- Endless Scroll now works with any elements, not just `$(document)`!\n\nv1.3 [2009-04-20]\n\n- Fixed a bug caused by `fireDelay`.\n\nv1.2 [2009-01-16]\n\n- Added `resetCounter` option.\n\nv1.1 [2009-01-15]\n\n- Added `fireDelay` option.\n\nv1.0 [2009-01-15]\n\n- Initial release.\n\n## More jQuery Plugins\n\nCheck out my other jQuery plugins:\n\n- [Inline Confirmation](https://github.com/fredwu/jquery-inline-confirmation) - One of the less obtrusive ways of implementing confirmation dialogues.\n- [Slideshow Lite](https://github.com/fredwu/jquery-slideshow-lite) - An extremely lightweight slideshow plugin for jQuery.\n\n## License\n\nCopyright (c) 2008-2012 Fred Wu\n\nDual licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL](http://www.gnu.org/licenses/gpl.html) licenses.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/fredwu/jquery-endless-scroll/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredwu%2Fjquery-endless-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredwu%2Fjquery-endless-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredwu%2Fjquery-endless-scroll/lists"}