{"id":17705003,"url":"https://github.com/dwqs/scroll-on-webview","last_synced_at":"2025-07-12T23:35:33.045Z","repository":{"id":87782421,"uuid":"149729770","full_name":"dwqs/scroll-on-webview","owner":"dwqs","description":"处理 webview 上的滚动","archived":false,"fork":false,"pushed_at":"2018-09-29T12:46:50.000Z","size":42,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-13T01:42:11.584Z","etag":null,"topics":["scroll","uiwebview","webview"],"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/dwqs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-21T07:54:44.000Z","updated_at":"2023-05-10T10:49:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"217d0ce4-40f6-48fc-8d80-e6258bc99c49","html_url":"https://github.com/dwqs/scroll-on-webview","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/dwqs%2Fscroll-on-webview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fscroll-on-webview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fscroll-on-webview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fscroll-on-webview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwqs","download_url":"https://codeload.github.com/dwqs/scroll-on-webview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237446296,"owners_count":19311293,"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":["scroll","uiwebview","webview"],"created_at":"2024-10-24T22:05:50.398Z","updated_at":"2025-02-06T09:15:42.797Z","avatar_url":"https://github.com/dwqs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![npm-version](https://img.shields.io/npm/v/@dwqs/scroll-on-webview.svg) ![license](https://img.shields.io/github/license/dwqs/scroll-on-webview.svg) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)\n\n\u003e 此项目产生的缘由是因为 [scroll 事件在 iOS UIWebViews 上的延迟触发](https://developer.mozilla.org/en-US/docs/Web/Events/scroll#Browser_compatibility), 基于 iscroll 改造\n\n## scroll-on-webview\nScroll on webview\n\n## Basic Usage\nInstall the pkg with npm or yarn:\n\n```shell\nnpm i --save @dwqs/scroll-on-webview\n\n// or\n\nyarn add @dwqs/scroll-on-webview\n```\n\nUse in the component:\n\n```js\nimport ScrollOnWebview from '@dwqs/scroll-on-webview'\n\nexport default class Hello extends React.Component {\n  render () {\n    return (\n      \u003cdiv id='hello'\u003eScroll Container\u003c/div\u003e\n    )\n  }\n\n  componentDidMount () {\n    this.scroller = new ScrollOnWebview('#hello', {\n      // your options\n    })\n  }\n}\n```\n\n## Options\n\u003e type格式：类型:默认值\n\n|name|type|desc|\n|:--:|:--:|:--:|\n|momentum|bool:true|是否增加弹性缓冲|\n|bindToWrapper|bool:true|是否将事件绑定在 Scroll Container 元素上|\n|HWCompositing|bool:true|是否启用硬件加速|\n|bounce|bool:true|滚动到边界时是否添加缓冲动画|\n|bounceTime|number:300|缓冲动画的持续时间, 单位 ms|\n|bounceEasing|string:''|缓冲动画的缓冲函数，内置可选值：quadratic/circular/back/bounce/elastic|\n|scrollX|bool:false|是否允许在X方向上滚动|\n|scrollY|bool:true|是否允许在Y方向上滚动|\n\n## Scroller 实例\n\n* `scroller.x` / `scroller.y`：当前的位置\n* `scroller.on` / `scroller.off`：自定义事件的监听和解绑\n\n```\nmyScroll = new ScrollOnWebview('#hello');\nmyScroll.on('scrollEnd', doSomething);\n```\n\n* `scrollStart`：开始滚动时触发\n* `scroll`：滚动时触发\n* `scrollEnd`：滚动结束时触发\n* `momentum`：执行弹性缓冲时触发\n\n## Development\n```shell\ngit clone git@github.com:dwqs/scroll-on-webview.git\n\ncd scroll-on-webview \u0026\u0026 npm i\n\nnpm run dev\n```\n\n## LICENSE\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fscroll-on-webview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwqs%2Fscroll-on-webview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fscroll-on-webview/lists"}