https://github.com/varletjs/bounce-fixer
Fixed bouncing caused by pull up or pull down on mobile web pages
https://github.com/varletjs/bounce-fixer
Last synced: about 1 year ago
JSON representation
Fixed bouncing caused by pull up or pull down on mobile web pages
- Host: GitHub
- URL: https://github.com/varletjs/bounce-fixer
- Owner: varletjs
- License: mit
- Created: 2023-05-22T15:32:17.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T08:04:42.000Z (over 2 years ago)
- Last Synced: 2025-04-08T14:02:43.508Z (about 1 year ago)
- Language: JavaScript
- Size: 419 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
### Intro
Fixed bouncing caused by pull up or pull down on mobile web pages
### Quickstart
#### CDN
```html
const { createBounceFixer } = BounceFixer
const { enable, disable } = createBounceFixer()
// enable bounce fixer
enable()
// disable bounce fixer
// disable()
```
#### npm/yarn/pnpm
```
# npm
npm i @varlet/bounce-fixer -S
# yarn
yarn add @varlet/bounce-fixer
# pnpm
pnpm add @varlet/bounce-fixer
```
```js
import { createBounceFixer } from '@varlet/bounce-fixer'
const { enable, disable } = createBounceFixer()
// enable bounce fixer
enable()
// disable bounce fixer
// disable()
```
### What problem to resolve
When using a scrollable container(e.g. using overflow: auto) on an iOS device and sliding the pointer to the bottom or top, the page bounces like rubber bands. And scrolling the page for a period of time will cause the page to bounce, affecting normal page scrolling.