{"id":18388061,"url":"https://github.com/methodgrab/scroll-to","last_synced_at":"2026-03-19T04:08:52.823Z","repository":{"id":9443540,"uuid":"62135322","full_name":"MethodGrab/scroll-to","owner":"MethodGrab","description":"A wrapper around `jQuery.animate({ scrollTop: offset })` to scroll the page to a specific element","archived":false,"fork":false,"pushed_at":"2023-01-06T03:51:40.000Z","size":1699,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T03:58:31.199Z","etag":null,"topics":["animation"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MethodGrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-28T11:24:38.000Z","updated_at":"2022-09-08T23:44:49.000Z","dependencies_parsed_at":"2023-01-11T19:31:17.629Z","dependency_job_id":null,"html_url":"https://github.com/MethodGrab/scroll-to","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fscroll-to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fscroll-to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fscroll-to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fscroll-to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MethodGrab","download_url":"https://codeload.github.com/MethodGrab/scroll-to/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514202,"owners_count":21116900,"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":["animation"],"created_at":"2024-11-06T01:30:37.928Z","updated_at":"2025-10-15T12:36:29.894Z","avatar_url":"https://github.com/MethodGrab.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scroll To [![Build Status](https://travis-ci.org/MethodGrab/scroll-to.svg?branch=master)](https://travis-ci.org/MethodGrab/scroll-to) [![npm](https://img.shields.io/npm/v/@methodgrab/scroll-to.svg)](https://www.npmjs.com/package/@methodgrab/scroll-to)\n\u003e A wrapper around `jQuery.animate({ scrollTop: offset })` to scroll the page to a specific element.\n\n\n## Install\n```bash\nnpm install --save @methodgrab/scroll-to\n```\n\n\n## Examples:\n```js\nconst scroll2 = require( '@methodgrab/scroll-to' );\n\n$( '.btn' ).on( 'click', function( e ) {\n\tscroll2( '.some-element' );\n});\n```\n\n```js\nconst scroll2 = require( '@methodgrab/scroll-to' );\n\n$( '.btn' ).on( 'click', function( e ) {\n\tscroll2( '.some-element', { duration: 1000, padding: 5 } )\n\t.then( () =\u003e console.log( 'Done!' ) );\n});\n```\n\n\n## API\n`scroll2( selector, { duration, padding } )`  \nReturns a `Promise` that resolves when the scroll completes\n\n### `selector`\n`String`  \nThe CSS selector of an element.\n\n### `options.duration`\n`Number` (default: `250`)  \nThe scroll duration in ms.\n\n### `options.padding`\n`Number` (default: `50`)  \nAn additional value, in px, to add to the scroll offset.  \nUseful to avoid scrolling to content under fixed headers etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fscroll-to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmethodgrab%2Fscroll-to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fscroll-to/lists"}