Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/riskers/turntable

转盘抽奖组件
https://github.com/riskers/turntable

component turntable

Last synced: 7 days ago
JSON representation

转盘抽奖组件

Awesome Lists containing this project

README

        

# Turntable
转盘抽奖

https://riskers.github.io/Turntable/example/index.html

## Install

### npm

```
npm install Turntable
```

### Yarn

```
yarn add Turntable
```

### script

```html

```

## Usage

### init

* container: @String 容器
* config: @Object
- turnsCount: 奖品个数
- pointer: 指针,如果传入,则指针转动,否则是转盘转动

```js
var turntable = new Turntable('#container', {
pointer: '#pointer',
turnsCount: turnsCount
})
```

### API

* `run()` 转盘开始转动
* `reset()` 重置转盘
* `done(index, fn)` 完成抽奖之后的回调
* index: 奖品索引
* fn: 回调