{"id":20473981,"url":"https://github.com/pecuchet/go-scroll-to","last_synced_at":"2025-07-09T12:09:49.549Z","repository":{"id":57251631,"uuid":"54735750","full_name":"pecuchet/go-scroll-to","owner":"pecuchet","description":"Small, smooth, speed-driven and stoppable scrolling to an element or a position, inside the viewport or a parent element.","archived":false,"fork":false,"pushed_at":"2018-12-07T20:21:47.000Z","size":11,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T13:48:02.885Z","etag":null,"topics":["scroll-to","scroll-to-element","scrollto"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pecuchet.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}},"created_at":"2016-03-25T17:39:15.000Z","updated_at":"2021-03-25T22:05:52.000Z","dependencies_parsed_at":"2022-09-04T23:10:42.714Z","dependency_job_id":null,"html_url":"https://github.com/pecuchet/go-scroll-to","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pecuchet/go-scroll-to","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecuchet%2Fgo-scroll-to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecuchet%2Fgo-scroll-to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecuchet%2Fgo-scroll-to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecuchet%2Fgo-scroll-to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pecuchet","download_url":"https://codeload.github.com/pecuchet/go-scroll-to/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pecuchet%2Fgo-scroll-to/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264456020,"owners_count":23611068,"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":["scroll-to","scroll-to-element","scrollto"],"created_at":"2024-11-15T14:27:25.357Z","updated_at":"2025-07-09T12:09:49.517Z","avatar_url":"https://github.com/pecuchet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-scroll-to 2\nA fast and lightweight (±595B gzipped) javascript module to smoothly scrollTo. It scrolls by speed instead of duration, to a position or an element, within the window or any scrollable parent element. And it's stoppable. And aside from a modern browser, it's dependency free.\n\n## !important\ngo-scroll-to has been rewritten to an ES6 module. If you still need support for older browsers use [version 1.0.3](https://github.com/pecuchet/go-scroll-to/releases/tag/1.0.3) (``npm install go-scroll-to@^1.0.3``)\n\n## Features\n\n- Scroll the window or any scrollable element\n- Scroll by speed: the duration is relative to the distance\n- Stop when the user manually scrolls (i.e. 'mouse wheels' or 'touch starts')\n- Sets an 'auto-scrolling' class name on the body element\n- Scroll to top, to a specific position or to an element\n- Offset the target position\n- Touch compatible\n\n## Examples\n### Scroll to top\n```\ngoScroll();\n```\n\n### Scroll to position inside a scrollable element\n```\ngoScroll({\n    to: 300,\n    context: document.getElementById('scrollable')\n    });\n```\n\n### Scroll slowly to element inside a scrollable element\n```\ngoScroll({\n    to: document.getElementById('element'),\n    speed: .3,\n    context: document.getElementById('scrollable')\n    });\n```\n\n## Install through npm\n```\nnpm install go-scroll-to\n```\nfor version 1: ``npm install go-scroll-to@^1.0.3``\n\n## All Options\n\n**to**: HTMLElement or Number. Default: 0  \n**offset**: Number, offset the target position. Default: 0  \n**context**: HTMLElement. Default: window  \n**speed**: Float greater than 0, higher is faster. Default: 2  \n**callback**: Function, triggered when target is reached or when the user interrupts the animation. The callback receives one argument, which will be `1` if the target position was reached. Default: undefined\n\n## License\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecuchet%2Fgo-scroll-to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpecuchet%2Fgo-scroll-to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecuchet%2Fgo-scroll-to/lists"}