{"id":16401658,"url":"https://github.com/robbendebiene/sliding-scroll","last_synced_at":"2025-03-23T05:31:10.983Z","repository":{"id":10221980,"uuid":"65016603","full_name":"Robbendebiene/Sliding-Scroll","owner":"Robbendebiene","description":"Minimal pure JavaScript smooth scrolling function.","archived":false,"fork":false,"pushed_at":"2022-05-03T18:14:56.000Z","size":24,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T18:06:07.855Z","etag":null,"topics":["javascript","pure-javascript","smooth-scrolling","smoothscroll"],"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/Robbendebiene.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}},"created_at":"2016-08-05T12:25:11.000Z","updated_at":"2024-04-02T17:40:47.000Z","dependencies_parsed_at":"2022-07-27T09:22:30.752Z","dependency_job_id":null,"html_url":"https://github.com/Robbendebiene/Sliding-Scroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robbendebiene%2FSliding-Scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robbendebiene%2FSliding-Scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robbendebiene%2FSliding-Scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robbendebiene%2FSliding-Scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robbendebiene","download_url":"https://codeload.github.com/Robbendebiene/Sliding-Scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061382,"owners_count":20554563,"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":["javascript","pure-javascript","smooth-scrolling","smoothscroll"],"created_at":"2024-10-11T05:43:47.702Z","updated_at":"2025-03-23T05:31:10.656Z","avatar_url":"https://github.com/Robbendebiene.png","language":"JavaScript","readme":"# Sliding-Scroll\n\n## A minimal pure JavaScript smooth scrolling function.\n\nScroll smoothly over time to a given absolute scroll position defined by the top and left properties.\u003cbr/\u003e\nIf the top or left scroll position is omitted it will fallback to the current scroll position.\n\n**duration:** Scroll duration in milliseconds; defaults to 0 (no transition)\u003cbr/\u003e\n**element:** The html element that should be scrolled; defaults to the main scrolling element\u003cbr/\u003e\n**easingFunction:** Defines the scrolling rate over time; defaults to ease in and out sin.\u003cbr/\u003e\nYou can either use one of the predefined functions from EASING_FUNCTIONS or a custom one.\n\n\n### Smooth scroll to function\n\n```javascript\nfunction smoothScrollTo({\n  top,\n  left,\n  duration = 0,\n  element = document.scrollingElement,\n  easingFunction = EASING_FUNCTIONS.slowInSlowOut\n})\n```\n\n### Additional convenience functions\n\n#### Scroll to the top of the main page\n```javascript\nsmoothScrollToTop({\n    duration = 0,\n    easingFunction = EASING_FUNCTIONS.slowInSlowOut\n})\n```\n\n#### Scroll to the bottom of the main page\n```javascript\nsmoothScrollToBottom({\n    duration = 0,\n    easingFunction = EASING_FUNCTIONS.slowInSlowOut\n})\n```\n\n#### Scroll to a specific element in the main page.\n```javascript\nsmoothScrollToElement(element, {\n  duration, easingFunction,\n  offsetTop = 0,\n  offsetLeft = 0\n})\n```\n\n#### Scroll to an element with a specific id in the main page.\n```javascript\nsmoothScrollToId(id, {\n  duration, easingFunction,\n  offsetTop = 0,\n  offsetLeft = 0,\n})\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbendebiene%2Fsliding-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobbendebiene%2Fsliding-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbendebiene%2Fsliding-scroll/lists"}