{"id":13671042,"url":"https://github.com/willhoag/scroll-to-element","last_synced_at":"2026-01-18T21:02:00.155Z","repository":{"id":28767296,"uuid":"32289646","full_name":"willhoag/scroll-to-element","owner":"willhoag","description":"Smooth scrolling to an element via selector or node reference","archived":false,"fork":false,"pushed_at":"2023-04-16T11:58:53.000Z","size":99,"stargazers_count":108,"open_issues_count":11,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-19T13:39:39.242Z","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/willhoag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2015-03-15T23:17:29.000Z","updated_at":"2025-02-17T08:26:55.000Z","dependencies_parsed_at":"2024-03-02T02:01:59.966Z","dependency_job_id":null,"html_url":"https://github.com/willhoag/scroll-to-element","commit_stats":{"total_commits":13,"total_committers":6,"mean_commits":"2.1666666666666665","dds":0.6923076923076923,"last_synced_commit":"a0969aa62671f2aa3fe29fb090aceae733ebb323"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/willhoag/scroll-to-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willhoag%2Fscroll-to-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willhoag%2Fscroll-to-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willhoag%2Fscroll-to-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willhoag%2Fscroll-to-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willhoag","download_url":"https://codeload.github.com/willhoag/scroll-to-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willhoag%2Fscroll-to-element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28550488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"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":[],"created_at":"2024-08-02T09:00:56.765Z","updated_at":"2026-01-18T21:02:00.138Z","avatar_url":"https://github.com/willhoag.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# scroll-to-element\n\nSmooth scrolls to element of the specified selector or element reference with optional offset, scroll-positon, easing, and duration. Takes into account document height for elements low on the page.\n\n[![NPM](https://nodei.co/npm/scroll-to-element.png)](https://nodei.co/npm/scroll-to-element/)\n\n## `scrollToElement(selector, \u003coptions\u003e)`\n##### Valid options:\n\n###### offset : *number*\n\n\u003e Add an additional offset to the final position. if\n\u003e \\\u003e 0 then page is moved to the bottom otherwise the page is moved to the top.\n\n###### align : *string*\n\n\u003e Alignment of the element in the resulting viewport. Can be\n\u003e one of `'top'`, `'middle'` or `'bottom'`. Defaulting to `'top'`.\n\n###### ease : *string*\n\n\u003e Easing function defaulting to \"out-circ\" (view [ease](https://github.com/component/ease) for more)\n\n###### duration : *number*\n\n\u003e Animation duration defaulting to `1000`\n\n##### Callback support\n\n\u003e scrollToElement emits an `end` event when the scroll animation is complete, and can be optionally consumed to perform a callback.\n\n\n## EXAMPLE\n\n```js\nvar scrollToElement = require('scroll-to-element');\n\nscrollToElement('#id');\n\n// with options\nscrollToElement('.className', {\n\toffset: 0,\n\tease: 'out-bounce',\n\tduration: 1500\n}).on('end', () =\u003e {\n\tconsole.log('Done scrolling!');\n});\n\n// or if you already have a reference to the element\nvar elem = document.querySelector('.className');\nscrollToElement(elem, {\n\toffset: 0,\n\tease: 'out-bounce',\n\tduration: 1500\n});\n```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillhoag%2Fscroll-to-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillhoag%2Fscroll-to-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillhoag%2Fscroll-to-element/lists"}