{"id":16785832,"url":"https://github.com/xwartz/antiscrolljs","last_synced_at":"2026-01-03T15:06:18.493Z","repository":{"id":58231595,"uuid":"42733578","full_name":"xwartz/antiscrolljs","owner":"xwartz","description":"自定义浏览器滚动条","archived":false,"fork":false,"pushed_at":"2015-09-29T07:44:44.000Z","size":428,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T01:05:40.639Z","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/xwartz.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":"2015-09-18T16:24:45.000Z","updated_at":"2015-09-19T01:54:55.000Z","dependencies_parsed_at":"2022-08-31T03:30:15.647Z","dependency_job_id":null,"html_url":"https://github.com/xwartz/antiscrolljs","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/xwartz%2Fantiscrolljs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwartz%2Fantiscrolljs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwartz%2Fantiscrolljs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwartz%2Fantiscrolljs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwartz","download_url":"https://codeload.github.com/xwartz/antiscrolljs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945561,"owners_count":20372897,"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":"2024-10-13T08:10:32.880Z","updated_at":"2026-01-03T15:06:18.463Z","avatar_url":"https://github.com/xwartz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Antiscroll: 自定义默认滚动条\n\nfork https://github.com/Automattic/antiscroll\n\n## Features\n\n- Supports mousewheels, trackpads, other input devices natively.\n- Total size is **1kb** minified and gzipped.\n- Doesn't magically autowrap your elements with divs\n- Fade in/out controlled with CSS3 animations.\n- Shows scrollbars upon hovering.\n- Scrollbars are draggable.\n- Size of container can be dynamically adjusted and scrollbars will adapt.\n- Supports IE7+, Firefox 3+, Chrome, Safari\n- IE10+, webkit 浏览器使用 css 隐藏默认滚动条\n- 动态计算滚动区域\n\n## Options\n```js\noptions = {\n    autoHide: true, // 默认自动隐藏\n    sizeFixed: false, //滚动区域大小固定, 可避免动态计算\n    vScroll: false, // 是否默认构建垂直滚动条, 根据滚动区域是否可更改(textarea)来设置\n    hScroll: false // 是否默认构建水平滚动条\n}\n```\n\n## Demo\n\nPlease click [here](http://codepen.io/xwartz/pen/Yyqdqb) to see it in action.\n\n## Usage\n\n1. 滚动区域标签添加 class ```antiscroll-inner```\n1. 滚动外框添加 class ```antiscroll-wrap```\n1. 初始化滚动条\n\n```javascript\n   $('.antiscroll-wrap').antiscroll();\n```\n\n## How does it work?\n\n1. 滚动外框设置 `overflow: hidden`\n2. 计算滚动区域的宽高，将其宽高加上滚动条的大小，使默认滚动条超出区域\n3. 监听事件，更新滚动条\n\n## Todo\n- [ ] Mac未插如鼠标，默认滚动条为0，Firefox下无法隐藏默认滚动条\n- [x] 当滚动区域在调用前未渲染或 `display:none;`,没法正确计算宽高(渲染之后调用或者异步)\n\n\n## Dependencies\n\n- [jQuery 2.0+](http://github.com/jquery/query)\n\n## License \n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwartz%2Fantiscrolljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwartz%2Fantiscrolljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwartz%2Fantiscrolljs/lists"}