{"id":20484021,"url":"https://github.com/nuxy/scroll-target-trigger","last_synced_at":"2026-02-09T18:03:22.846Z","repository":{"id":186640142,"uuid":"675435578","full_name":"nuxy/scroll-target-trigger","owner":"nuxy","description":":dart: Lightweight, dependency free, scroll event methods.","archived":false,"fork":false,"pushed_at":"2024-08-04T17:13:56.000Z","size":985,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-05T08:45:48.426Z","etag":null,"topics":["javascript","observers","plugins","scroller","trigger-events"],"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/nuxy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-06T22:48:01.000Z","updated_at":"2024-08-04T17:13:38.000Z","dependencies_parsed_at":"2024-11-15T16:31:34.811Z","dependency_job_id":null,"html_url":"https://github.com/nuxy/scroll-target-trigger","commit_stats":null,"previous_names":["nuxy/scroll-target-trigger"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nuxy/scroll-target-trigger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Fscroll-target-trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Fscroll-target-trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Fscroll-target-trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Fscroll-target-trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxy","download_url":"https://codeload.github.com/nuxy/scroll-target-trigger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Fscroll-target-trigger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29274741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T17:15:22.002Z","status":"ssl_error","status_checked_at":"2026-02-09T17:14:42.395Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","observers","plugins","scroller","trigger-events"],"created_at":"2024-11-15T16:19:35.342Z","updated_at":"2026-02-09T18:03:22.785Z","avatar_url":"https://github.com/nuxy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scroll Target Trigger\n\n[![npm version](https://badge.fury.io/js/scroll-target-trigger.svg)](https://badge.fury.io/js/scroll-target-trigger) [![](https://img.shields.io/npm/dm/scroll-target-trigger)](https://www.npmjs.com/package/scroll-target-trigger) [![Build Status](https://img.shields.io/github/actions/workflow/status/nuxy/scroll-target-trigger/.github%2Fworkflows%2Fci.yml)](https://github.com/nuxy/scroll-target-trigger/actions) [![Install size](https://packagephobia.com/badge?p=scroll-target-trigger)](https://packagephobia.com/result?p=scroll-target-trigger) [![](https://img.shields.io/github/v/release/nuxy/scroll-target-trigger)](https://github.com/nuxy/scroll-target-trigger/releases)\n\nLightweight, dependency free, scroll event methods.\n\n## Dependencies\n\n- [Node.js](https://nodejs.org)\n\n## Installation\n\nInstall the package into your project using [NPM](https://npmjs.com), or download the [sources](https://github.com/nuxy/scroll-target-trigger/archive/master.zip).\n\n    $ npm install scroll-target-trigger\n\n## Usage\n\nThere are two ways you can use this package.  One is by including the JavaScript source directly.  The other is by importing the module into your component.\n\n### Script include\n\nAfter you [build the distribution sources](#cli-options) the set-up is fairly simple..\n\n```html\n\u003cscript type=\"text/javascript\" src=\"path/to/scroll-target-trigger.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n  scrollTargetTrigger(element | position, callback).trigger(threshold);\n\u003c/script\u003e\n```\n\n### Module import\n\nIf your using a modern framework like [Aurelia](https://aurelia.io), [Angular](https://angular.io), [React](https://reactjs.org), or [Vue](https://vuejs.org)\n\n```javascript\nimport ScrollTargetTrigger from 'scroll-target-trigger';\n\nconst scroll = new ScrollTargetTrigger(element | position, callback);\nscroll.target(behavior);\n```\n\n## Methods\n\nThe following methods are supported by this package:\n\n| Method    | Description                                                       | Argument (optional)   |\n|-----------|-------------------------------------------------------------------|-----------------------|\n| `target`  | Scroll to an `Element` or `document` position _when executed_.    | auto, instant, smooth |\n| `trigger` | Run callback _when scrolled_ to `Element` or `document` position. | `Number` default: 100 |\n| `destroy` | Removes registered scroll event listener.                         |                       |\n\n### Examples\n\nAdd a class name to an `Element` when scrolled to position.\n\n```javascript\nconst elm = document.getElementById('target');\n\nscrollTargetTrigger(elm, function(active) {\n  if (active) {\n    elm.classList.add('triggered');\n  } else {\n\n    // Remove at 100px above 'target'\n    elm.classList.remove('triggered');\n  }\n}).trigger(100);\n```\n\nScroll to an `Element` position instantly in a single jump.\n\n```javascript\nconst elm = document.getElementById('target');\n\nconst scroll = new ScrollTargetTrigger(elm);\nscroll.target('instant');\n```\n\nScroll to `document` position in a smooth animation.\n\n```javascript\nconst scroll = new ScrollTargetTrigger(500); // Y: 500px\nscroll.target('smooth');\n```\n\n## Developers\n\n### CLI options\n\nRun [ESLint](https://eslint.org) on project sources:\n\n    $ npm run lint\n\nTranspile ES6 sources (using [Babel](https://babeljs.io)) and minify to a distribution:\n\n    $ npm run build\n\nRun [WebdriverIO](https://webdriver.io) E2E tests:\n\n    $ npm run test\n\n## Motivation\n\nIn the sea of NPM [packages related to scroll events](https://www.npmjs.com/search?q=scroll-event), many of the packages I evaluated are..\n\n- Unsupported, or have been completely abandoned.\n- Tightly coupled with the [jQuery](https://jquery.com) or `\u003cinsert SPA framework here\u003e`.\n- Contain unnecessary usage of 3rd-party dependencies.\n- Rich with features, but limited callback support.\n\nIn the end, I wanted a single library, no dependencies, with a simple interface (no bells and whistles) that provides `target` and `trigger` event handlers with callback support.\n\nMy search fell short so I created this package.\n\n## Contributions\n\nIf you fix a bug, or have a code you want to contribute, please send a pull-request with your changes. (Note: Before committing your code please ensure that you are following the [Node.js style guide](https://github.com/felixge/node-style-guide))\n\n## Versioning\n\nThis package is maintained under the [Semantic Versioning](https://semver.org) guidelines.\n\n## License and Warranty\n\nThis package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.\n\n_scroll-target-trigger_ is provided under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php)\n\n## Author\n\n[Marc S. Brooks](https://github.com/nuxy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Fscroll-target-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxy%2Fscroll-target-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Fscroll-target-trigger/lists"}