# better-scroll
**Repository Path**: worldcode7753/better-scroll
## Basic Information
- **Project Name**: better-scroll
- **Description**: BetterScroll 是一款重点解决移动端各种滚动场景需求的开源插件,适用于滚动列表、选择器、轮播图、索引列表、开屏引导等应用场景
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: dev
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 18
- **Created**: 2021-09-17
- **Last Updated**: 2021-09-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# better-scroll
[](https://www.npmjs.com/package/better-scroll) [](https://www.npmjs.com/package/better-scroll) [](https://travis-ci.org/ustbhuangyi/better-scroll) [](http://packagequality.com/#?package=better-scroll) [](http://codecov.io/github/ustbhuangyi/better-scroll) [](https://gitpod.io/from-referrer/)
[中文文档](https://github.com/ustbhuangyi/better-scroll/blob/master/README_zh-CN.md)
[1.x Docs](https://better-scroll.github.io/docs-v1/)
[2.x Docs](https://better-scroll.github.io/docs/en-US/)
[2.x Demo](https://better-scroll.github.io/examples/)
> **Note**: `1.x` is not maintained. please migrate your version as soon as possible
# Install
```bash
npm install better-scroll -S # install 2.x,with full-featured plugin.
npm install @better-scroll/core # only CoreScroll
```
```js
import BetterScroll from 'better-scroll'
let bs = new BetterScroll('.wrapper', {
movable: true,
zoom: true
})
import BScroll from '@better-scroll/core'
let bs = new BScroll('.wrapper', {})
```
# CDN
BetterScroll with full-featured plugin.
```html
```
```js
let wrapper = document.getElementById("wrapper")
let bs = BetterScroll.createBScroll(wrapper, {})
```
Only CoreScroll
```html
```
```js
let wrapper = document.getElementById("wrapper")
let bs = new BScroll(wrapper, {})
```
## What is BetterScroll ?
BetterScroll is a plugin which is aimed at solving scrolling circumstances on the mobile side (PC supported already). The core is inspired by the implementation of [iscroll](https://github.com/cubiq/iscroll), so the APIs of BetterScroll are compatible with iscroll on the whole. What's more, BetterScroll also extends some features and optimizes for performance based on iscroll.
BetterScroll is implemented with plain JavaScript, which means it's dependency free.
## Getting started
The most common application scenario of BetterScroll is list scrolling. Let's see its HTML:
```html