{"id":18187987,"url":"https://github.com/alterx/lovely-infinite-scrolling","last_synced_at":"2025-06-12T17:07:42.608Z","repository":{"id":67823600,"uuid":"11905106","full_name":"alterx/lovely-infinite-scrolling","owner":"alterx","description":"Add awesome functionality to your infinite scroll implementation ","archived":false,"fork":false,"pushed_at":"2013-08-16T23:13:06.000Z","size":196,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T13:47:25.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alterx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-05T18:04:40.000Z","updated_at":"2014-06-02T15:49:55.000Z","dependencies_parsed_at":"2023-02-20T22:30:42.335Z","dependency_job_id":null,"html_url":"https://github.com/alterx/lovely-infinite-scrolling","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alterx/lovely-infinite-scrolling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alterx%2Flovely-infinite-scrolling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alterx%2Flovely-infinite-scrolling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alterx%2Flovely-infinite-scrolling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alterx%2Flovely-infinite-scrolling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alterx","download_url":"https://codeload.github.com/alterx/lovely-infinite-scrolling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alterx%2Flovely-infinite-scrolling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259509429,"owners_count":22868834,"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-11-03T02:04:16.138Z","updated_at":"2025-06-12T17:07:42.552Z","avatar_url":"https://github.com/alterx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lovely Infinite Scrolling (LovelyIS)\n------------------------------------\n\n\nDon't you think infinite scroll should do better? Why can't I continue where I left if I reload my page or hit the back button?\nI think you should, that's the way infinite scrolling should work everywhere. \n \nLovely Infinite scrolling adds this functionality to your current implemententation in no time.\nIt's as easy as initialising LovelyIS with a couple of selectors (for your items and footer (last element in the list), the target for the binding)\nand attaching two functions to your current implementation: duringScroll() and afterAppend(). As you can tell by their names the first one needs to\nbe invoked every time you track the scroll event and the second after you've already appended the new page. That's it! Sit back and enjoy :)\n \nRequisites\n----------\n\n* jQuery\n* All your list items should have an unique id that can be either the html element id ( id=\"unique-id\" )\nor a data- attribute ( data-id=\"unique-id\" ).\n* History API support ( or include a polyfill :) like this one --\u003e https://github.com/devote/HTML5-History-API ) \n\n \nPros\n----\n* It makes any* (see cons section here) implementation work as described with just a couple of steps.\n* Doesn't break the back button (for the sake of the UX!) \n* Continue right where you ended up while scrolling down \n\nCons\n----\n* You can bookmark items, but since you have a dinamically created list at some point the items will probably move to the next\npage and the bookmark will no longer work. \n* If your feed updates really quick ( like twitter or facebook ) you might lose the relation between the page and the item id (so you won't reach the correct item when hitting back) \n* Your site might end up being so awesome it could explode D: \n\nTODOs\n-----\n* Figure out something to work out the quickly-updated-feed issue (the bigger the number of items per page the less possibilities of this happening)\n Still, you should be able to check (server side) if the id corresponds to the page or return the correct page instead :) \n\nHow to\n------\n\nJust include the minified (or unminified version) of the plugin in your page and configure it as follows:\n\n        LovelyIS.init({\n                selectors : {\n                    item: 'item selector',\n                    footer: 'last item selector'\n                },\n                binder : $(window),  \n                usingData : true     //default is false and will use the element's id\n            });\n\nThen just make sure to call: \n\n        LovelyIS.afterAppend(); //Just after the new content is appended.\n\nand   \n\n        LovelyIS.duringScroll(); //Everytime you track the scroll event.\n\nAnd Voila! :D ISn't that Lovely? \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falterx%2Flovely-infinite-scrolling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falterx%2Flovely-infinite-scrolling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falterx%2Flovely-infinite-scrolling/lists"}