All Projects → riskers → Turntable

riskers / Turntable

Licence: other
转盘抽奖组件

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Turntable

react-turntable
🎯 A HTML5 raffle turntable component for react
Stars: ✭ 22 (-15.38%)
Mutual labels:  turntable
ETurntable
ETurntable
Stars: ✭ 17 (-34.62%)
Mutual labels:  turntable

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: 回调
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].