Turntable
v0.0.5
Published
转盘抽奖组件
Downloads
5
Readme
Turntable
转盘抽奖
https://riskers.github.io/Turntable/example/index.html
Install
npm
npm install Turntable
Yarn
yarn add Turntable
script
<script src="lib/Turntable.min.js"></script>
Usage
init
- container: @String 容器
- config: @Object
- turnsCount: 奖品个数
- pointer: 指针,如果传入,则指针转动,否则是转盘转动
var turntable = new Turntable('#container', {
pointer: '#pointer',
turnsCount: turnsCount
})
API
run()
转盘开始转动reset()
重置转盘done(index, fn)
完成抽奖之后的回调- index: 奖品索引
- fn: 回调