{"id":20196870,"url":"https://github.com/itsjonq/scrolley","last_synced_at":"2025-04-10T10:44:16.188Z","repository":{"id":143907821,"uuid":"161226338","full_name":"ItsJonQ/scrolley","owner":"ItsJonQ","description":"🐹 Scrolley: Extra scroll event listeners for DOM Elements!","archived":false,"fork":false,"pushed_at":"2018-12-17T19:39:14.000Z","size":728,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-09-19T16:44:55.496Z","etag":null,"topics":["dom-element","events","javascript","listener","scroll","scroll-events"],"latest_commit_sha":null,"homepage":"https://scrolley.netlify.com/","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/ItsJonQ.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-10T19:31:40.000Z","updated_at":"2022-12-25T13:45:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"1957bf98-cd53-466b-adc6-3c55864341c3","html_url":"https://github.com/ItsJonQ/scrolley","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fscrolley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fscrolley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fscrolley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fscrolley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsJonQ","download_url":"https://codeload.github.com/ItsJonQ/scrolley/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248200627,"owners_count":21063938,"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":["dom-element","events","javascript","listener","scroll","scroll-events"],"created_at":"2024-11-14T04:26:27.534Z","updated_at":"2025-04-10T10:44:16.181Z","avatar_url":"https://github.com/ItsJonQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐹 Scrolley\n\n[![Build Status](https://travis-ci.org/ItsJonQ/scrolley.svg?branch=master)](https://travis-ci.org/ItsJonQ/scrolley)\n[![npm version](https://badge.fury.io/js/scrolley.svg)](https://badge.fury.io/js/scrolley)\n[![Coverage Status](https://coveralls.io/repos/github/ItsJonQ/scrolley/badge.svg?branch=master)](https://coveralls.io/github/ItsJonQ/scrolley?branch=master)\n\n\u003e Extra scroll event listeners for DOM Elements!\n\n## Features\n\n- **Zero dependencies!**\n- Super tiny, at ~600B gzipped\n- Ultra fast performance\n\n## Table of contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Installation](#installation)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Events](#events)\n- [Examples](#examples)\n- [See also](#see-also)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\nTo start using scrolley, add it to your project using [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/en/) by running:\n\n```\n// npm\nnpm install --save scrolley\n\n// yarn\nyarn add scrolley\n```\n\n## Setup\n\nTo start listening to [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) scroll events, simply import **Scrolley** somewhere in your project, like so:\n\n```js\nimport 'scrolley'\n```\n\nAnd that's it! 🙌\n\n## Usage\n\n**Scrolley**'s events can be added/removed on a DOM element, just like any other native event, like `click`, `mouseenter`, or `mousemove`.\n\n```js\n...\n// Get your Element\nconst element = document.querySelector('.el')\n// Define a callback when the element scrolls\nconst callbackFn = event =\u003e console.log(event)\n\n// Subscribe\nelement.addEventListener('scrollDown', callbackFn)\n\n// Unsubscribe\nelement.removeEventListener('scrollDown', callbackFn)\n```\n\nThis library also supports a handful of other scroll events!\n\n## Events\n\nBelow are the events that this module provides:\n\n| Event name         | Description                                                                  |\n| ------------------ | ---------------------------------------------------------------------------- |\n| `scrollUp`         | Fires immediately after the `Element` scrolls upward.                        |\n| `scrollDown`       | Fires immediately after the `Element` scrolls downward.                      |\n| `scrollToTop`      | Fires immediately (once) after the `Element` scrolls to the very top.        |\n| `scrollToBottom`   | Fires immediately (once) after the `Element` scrolls to the very bottom.     |\n| `scrollFromTop`    | Fires immediately (once) after the `Element` scrolls from the very top.      |\n| `scrollFromBottom` | Fires immediately (once) after the `Element` scrolls bottom the very bottom. |\n\n## Examples\n\nCheck out this simply [Storybook demo](https://scrolley.netlify.com/). It was built with React. However, **Scrolley** is plain ol' vanilla JavaScript. It can work with anything JavaScript supported app, plugin, library, or framework.\n\n## See also\n\n- [Resizey](https://github.com/ItsJonQ/resizey)\n\n## License\n\nMIT © [Q](https://jonquach.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjonq%2Fscrolley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsjonq%2Fscrolley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjonq%2Fscrolley/lists"}