{"id":24727371,"url":"https://github.com/sayhellogmbh/js-hashscroll","last_synced_at":"2026-05-01T00:31:25.059Z","repository":{"id":78920052,"uuid":"166393311","full_name":"SayHelloGmbH/js-hashscroll","owner":"SayHelloGmbH","description":"jQuery function to provide smooth scrolling to an element which matches a URL hash.","archived":false,"fork":false,"pushed_at":"2019-01-18T11:26:32.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T05:55:45.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/SayHelloGmbH.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-18T11:15:50.000Z","updated_at":"2019-01-18T11:26:33.000Z","dependencies_parsed_at":"2023-02-25T04:45:23.954Z","dependency_job_id":null,"html_url":"https://github.com/SayHelloGmbH/js-hashscroll","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/SayHelloGmbH%2Fjs-hashscroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SayHelloGmbH%2Fjs-hashscroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SayHelloGmbH%2Fjs-hashscroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SayHelloGmbH%2Fjs-hashscroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SayHelloGmbH","download_url":"https://codeload.github.com/SayHelloGmbH/js-hashscroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244974870,"owners_count":20541195,"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":[],"created_at":"2025-01-27T14:58:44.820Z","updated_at":"2026-05-01T00:31:24.300Z","avatar_url":"https://github.com/SayHelloGmbH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smooth anchor scrolling\n\njQuery script which checks the page URI for an anchor and scrolls to the target element smoothly.\n\n## Usage\n\n* Add an `id=` attribute to the element to which you want to scroll, which must match the location hash in the browser. e.g. `id=\"comments\"`.\n* Link to this element as usual: e.g. `\u003ca href=\"#comments\"\u003eScroll to comments\u003c/a\u003e`.\n* Initialize the JavaScript.\n\n### Initialize the JavaScript\n\n```javascript\n$('a[href*=\"#\"]').anchorAnimate();\n```\n\n### Scrolling manually\n\n```javascript\n$('#comments').scrollToMe();\n```\n\n### Adding an offset\n\ne.g. if you have a fixed toolbar. Update the value of the JavaScript variable `window.anchorAnimateOffset`.\n\n```javascript\n// General offset\nwindow.anchorAnimateOffset = 16;\n\n// Extend window.anchorAnimateOffset variable with your fixed elements\nvar setAnchorOffset = function(){\n\t$('.nav.toolbar').each(function(){\n\t\tif ( $(this).outerHeight() \u0026\u0026 $(this).css(\"position\") === \"fixed\"){\n\t\t\twindow.anchorAnimateOffset += $(this).outerHeight();\n\t\t}\n\t});\n\twindow.anchorAnimateOffset = Math.floor(window.anchorAnimateOffset) - 1;\n};\n\n// Initialize the functionality\n$(document).on('ready.anchoranimate', function(){\n\t$('a[href*=\"#\"]').anchorAnimate();\n});\n\n// Update window.anchorAnimateOffset value\n$(window).on('load.anchoranimate resize.anchoranimate', setAnchorOffset);\n\n```\n\n### Following events are triggered\n\n```javascript\n$(window).trigger('ct-hashscroll/scroll-start', window.anchorAnimateOffset, destinationTop);\n```\n\n### Example of responding to a custom event\n\n```javascript\n$(window).on('ct-hashscroll/scroll-start', function(event, anchorAnimateOffset, destinationTop){\n    window.console.log([anchorAnimateOffset, destinationTop]);\n});\n```\n\n## Changelog\n\n### 1.0.0 2019-01-18\n\n* Initial @sayhellogmbh version.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayhellogmbh%2Fjs-hashscroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayhellogmbh%2Fjs-hashscroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayhellogmbh%2Fjs-hashscroll/lists"}