更新时间:2019-12-12 23:17:07
如效果不完全能满足需求,可自行修改源码
参数
1 2 3 4 5 6 7 | target: '.lottery-wrap', // 旋转对象easing: 'easeInOutSine', // anime.js 动画曲线isplay: false, // 动画是否在播放duration: 3000, // 动画时长rotateNum: 5, // 旋转圈数total: 8, // 奖励个数offset: 0, // 旋转偏移值 |
使用方法
1 2 3 4 5 6 7 8 | var Lottery = Turntable.create();$('.lottery-btn').on('click', function() { var num = Math.floor(Math.random() * 8); Lottery.start(num, function(index) { //转盘动画结束回调 alert($('span').eq(index).find('i').text()); console.log('index', index, 'lottery-span', 'lottery-span' + (index + 1)); });}); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com