Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riskers/turntable
转盘抽奖组件
https://github.com/riskers/turntable
component turntable
Last synced: 7 days ago
JSON representation
转盘抽奖组件
- Host: GitHub
- URL: https://github.com/riskers/turntable
- Owner: riskers
- Created: 2016-11-28T09:27:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T14:49:54.000Z (almost 2 years ago)
- Last Synced: 2024-09-23T09:11:44.508Z (about 2 months ago)
- Topics: component, turntable
- Language: JavaScript
- Homepage: https://riskers.github.io/Turntable/example/index.html
- Size: 656 KB
- Stars: 30
- Watchers: 3
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
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: 回调