{"id":48112002,"url":"https://github.com/bukacekd/lock-scroll","last_synced_at":"2026-04-04T16:09:22.986Z","repository":{"id":185560315,"uuid":"673745379","full_name":"bukacekd/lock-scroll","owner":"bukacekd","description":"A set of methods to lock scrolling within an element or an entire page.","archived":false,"fork":false,"pushed_at":"2026-04-04T15:04:43.000Z","size":211,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T15:59:56.373Z","etag":null,"topics":["android","body","desktop","ios","lock","mobile","modal","overflow","scroll","scrollbar","tablet","toggle"],"latest_commit_sha":null,"homepage":"https://bukacekd.github.io/lock-scroll","language":"TypeScript","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/bukacekd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null}},"created_at":"2023-08-02T10:23:47.000Z","updated_at":"2026-04-04T15:04:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"35fcc2f9-e49c-47e2-81f0-56998f00052b","html_url":"https://github.com/bukacekd/lock-scroll","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"58afdb472cf2257f1c3a48cb717b1cff9a2f2424"},"previous_names":["bukacekd/lock-scroll"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bukacekd/lock-scroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukacekd%2Flock-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukacekd%2Flock-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukacekd%2Flock-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukacekd%2Flock-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bukacekd","download_url":"https://codeload.github.com/bukacekd/lock-scroll/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukacekd%2Flock-scroll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31405589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["android","body","desktop","ios","lock","mobile","modal","overflow","scroll","scrollbar","tablet","toggle"],"created_at":"2026-04-04T16:09:21.673Z","updated_at":"2026-04-04T16:09:22.967Z","avatar_url":"https://github.com/bukacekd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lock scroll\n\n\u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@js4y/lock-scroll\"\u003e\u003cimg src=\"https://img.shields.io/badge/dependencies-none-green.svg\" alt=\"none dependencies\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@js4y/lock-scroll\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/%40js4y%2Flock-scroll\" alt=\"npm\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@js4y/lock-scroll\"\u003e\u003cimg src=\"https://deno.bundlejs.com/badge?q=@js4y/lock-scroll\u0026treeshake=[*]\" alt=\"npm bundle size\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/%40js4y%2Flock-scroll\" alt=\"license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA set of methods to lock scrolling within an element or an entire page on mobile devices, tablets and desktops.\n\nLive Demo: https://bukacekd.github.io/lock-scroll\n\n## Features\n\n- [easy to use](#usage)\n- compatible with Android, IOS, MacOS and Windows\n- compatible with mobile devices, tablets and desktops\n- preserves the space corresponding to the width of the scrollbar\n\n## Installation\n\nNpm\n\n```bash\nnpm install @js4y/lock-scroll\n```\n\nCDN\n\n```bash\n\u003cscript src=\"https://unpkg.com/@js4y/lock-scroll/dist/index.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nNpm\n\n```javascript\nimport {lockScroll, unlockScroll} from '@js4y/lock-scroll';\n\n// lock scrolling\nlockScroll();\n// unlock scrolling\nunlockScroll();\n```\n\nCDN\n\n```javascript\n\u003cscript src=\"https://unpkg.com/@js4y/lock-scroll/dist/index.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n    // lock scrolling\n    js4y.scrolling.lockScroll();\n    // unlock scrolling\n    js4y.scrolling.unlockScroll();\n\u003cscript\u003e\n```\n\n## Methods\n\n### lockScroll(target?: HTMLElement): void\n\nLock scrolling within an element or an entire page.\n\n```javascript\n// lock page scrolling\nlockScroll();\n\n// lock scrolling for specific element\nlockScroll(document.getElementById('scrollable-element'));\n```\n\n### unlockScroll(target?: HTMLElement): void\n\nUnlock scrolling within an element or an entire page.\n\n```javascript\n// unlock page scrolling\nunlockScroll();\n\n// unlock scrolling for specific element\nunlockScroll(document.getElementById('scrollable-element'));\n```\n\n## Browser support\n\n| ![alt chrome](images/chrome.png) | ![alt edge](images/edge.png)  | ![alt firefox](images/firefox.png)  | ![alt opera](images/opera.png) | ![alt safari](images/safari.png) |\n| :-: | :-: | :-: | :-: | :-: |\n| Chrome 69+ | Edge 79+ | Firefox 41+ | Opera 56+ | Safari 12.1+ |\n\n## License\n\nThe project is licensed under [MIT license](https://opensource.org/license/mit/).\n\n## Related\n\n- [CountUp](https://github.com/bukacekd/count-up) - A tiny dependency-free JavaSript library for animating numeric values.\n- [Dialog](https://github.com/bukacekd/dialog) - A tiny dependency-free JavaSript ES6 library built on a dialog element with minimal configuration.\n- [Loader](https://github.com/bukacekd/loader) - A tiny dependency-free javascript loading spinner component with minimal configuration.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukacekd%2Flock-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbukacekd%2Flock-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukacekd%2Flock-scroll/lists"}