Code Monkey home page Code Monkey logo

jslotsplus's Introduction

jSlotsPlus

ver 0.2

based on jSlots ( matthewlein/jQuery-jSlots )

Options

    $.jSlots.defaultOptions = {
        number : 3,          // Number: number of slots
        winnerNumber : 1,    // Number or Array: list item number(s) upon which to trigger a win, 1-based index, NOT ZERO-BASED
        spinner : '',        // CSS Selector: element to bind the start event to
        spinEvent : 'click', // String: event to start slots on this event
        onInit : $.noop,     // Function: runs on init,
        onStart : $.noop,    // Function: runs on spin start,
        onEnd : $.noop,      // Function: run on spin end. It is passed (finalNumbers:Array). finalNumbers gives the index of the li each slot stopped on in order.
        onWin : $.noop,      // Function: run on winning number. It is passed (winCount:Number, winners:Array, finalNumbers:Array)
        easing : 'swing',    // String: easing type for final spin. I recommend the easing plugin and easeOutSine, or an easeOut of your choice.
        time : 7000,         // Number: total time of spin animation
        loops : 6            // Number: times it will spin during the animation
        result : {},         // object: set result, like {0:7, 1:6, 2:5} will get 765

    };

what is new

  1. Add a parameter "result", it can set a regular number instead of a random number.

     result : {0:7, 1:6, 2:5}
    

    It will display "765", more or less is fine.

  2. Add a method "onInit"

  3. Result numbers can be changed.

     var jsSlot = $('.slot').jSlotsPlus({
         result: {0:7,1:6,2:5}
     })[0];
     
     // if u want to change result numbers
     jsSlot.options.result = {0:1,1:2,2:3};
    

Other usage details please visit https://github.com/matthewlein/jQuery-jSlots

jslotsplus's People

Watchers

 avatar

Forkers

laruche marilynf

jslotsplus's Issues

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.