Code Monkey home page Code Monkey logo

lottery's Introduction

Lottery

基于jQuery抽奖组件,用React实现

Lottery.lottery({
            selector  : '#J_lotteryPc',
            button    : '#J_lotteryBtn',
            width     : 3,    //长
            height    : 3,    //高
            index     : 0,    // 初始位置
            initSpeed : 500,  // 初始转动速度
            upStep    : 50,   // 加速滚动步长
            upMax     : 50,   // 速度上限
            downStep  : 30,   // 减速滚动步长
            downMax   : 500,  // 减速上限
            waiting   : 5000, // 匀速转动时长
            target    : that._getId(_details, _defaultID), //中奖id,可通过后台算法来获得,默认值:最便宜的一个奖项或者"谢谢参与"
            beforeRoll: function () { // 重写滚动前事件:beforeRoll
                console.log("开始抽奖");

            },
            beforeDown: function () {//重写减速之前的操作
                console.log("减速了");
            },
            callBack  : function () {//重写转盘停止自定义事件
                console.log("抽奖结束");
            },
            _stop     : function () { // 重写转盘停止,没有抽奖机会后禁用按钮
                //没有抽奖机会
            }

        });

lottery's People

Contributors

hancoson avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.