Giter Club home page Giter Club logo

jquery-jslots's People

Contributors

matthewlein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-jslots's Issues

How to Set END NUMBERS Solved

Hi
Firs thanks for this awesome jslot. I used it in mvc project i am completely newbie to programing and some how make it work for 0-10 numbers.
if any one have issue about this you can see my code if it can be any help

<div class="container">
        <div class="row">
            <div id="WinScroll" class="text-center">
                <div class="fancy">
                    <ul class="slot">
                        <li>1</li>
                        <li>2</li>
                        <li>3</li>
                        <li>4</li>
                        <li>5</li>
                        <li>6</li>
                        <li>7</li>
                        <li>8</li>
                        <li>9</li>
                        <li>0</li>
                    </ul>
                    <input type="button" value="test" id="playBtn"   />
                </div>
            </div>
        </div>
    </div>

END Numbers are coming from variable winnerNumber which i get from @model in MVC
There was a problem it wont get data directly from variable which is coming from database you have to explicitly give the value.

    var myArray = [];
    @foreach (var d in Model)
    {
        @:myArray.push("@d");
    }
Data get into Array Then
 for (i = 0; i < myArray.length; i++) {
                    var tim_win= myArray[i];

}

i get data from model and save it in variable and then but the END NUMBER wont get it so i have to get the value from variable and then compare then value in IF Else and get him the direct variable like w1 =3 so the END Number can get this value directly not the value directly coming from data base but the value which is equal to the database
here is example how i done it
i get the data base value in win and there are three numbers in it so separate them in three Ints

                        var winS = win;
// in my case only three integers are coming from data base like 123
                        var First = parseInt(winS[0]);     //get first character 
                        var Second = parseInt(winS[1]); //get Second character 
                        var Third = parseInt(winS[2]);  //get Thirdcharacter 

and then get the vale in First you have to explicitly give the value to w1 END NUMBER

                        if (First == 0) { w1 = 10; }
                        else if (First == 1) { w1 = 1; }
                        else if (First == 2) { w1 = 2; }
                        else if (First == 3) { w1 = 3; }
                        else if (First == 4) { w1 = 4; }
                        else if (First == 5) { w1 = 5; }
                        else if (First == 6) { w1 = 6; }
                        else if (First == 7) { w1 = 7; }
                        else if (First == 8) { w1 = 8; }
                        else if (First == 9) { w1 = 9; }

Do this also for the second value and third value which is in this case w2 and w3
now send this w1,w2,w3 value to the END NUMBERS

                        $(document).ready(function () {
                            $('.slot').jSlots({
                                spinner: '#playBtn',
                                endNumbers: [w1 , w2 , w3] //<----- Added endNumbers option 
                            });
                        });

Its done.I Hope it helps i am newbie so cant explain it well

Set one winning slot not more than one?

Hi, is there a possibility we can set only one winner slot currently it is sometimes one and sometimes more than one but how we can strict only one slot should become winner. secondly how to set on each spin there should must be one winner.?

index.html

<title>jSlots Slot Machine - Matthew Lein</title> <style type="text/css"> ul { padding: 0; margin: 0; list-style: none; } .jSlots-wrapper { overflow: hidden; height: 20px; display: inline-block; /* to size correctly, can use float too, or width*/ border: 1px solid #999; } .slot { float: left; } input[type="button"] { display: block; } /* --------------------------------------------------------------------- FANCY EXAMPLE --------------------------------------------------------------------- */ .fancy .jSlots-wrapper { overflow: hidden; height: 100px; display: inline-block; /* to size correctly, can use float too, or width*/ border: 1px solid #999; } .fancy .slot li { width: 100px; line-height: 100px; text-align: center; font-size: 70px; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8); font-family: 'Gravitas One', serif; border-left: 1px solid #999; } .fancy .slot:first-child li { border-left: none; } .fancy .slot li:nth-child(7) { background-color: #FFCE29; } .fancy .slot li:nth-child(6) { background-color: #FFA22B; } .fancy .slot li:nth-child(5) { background-color: #FF8645; } .fancy .slot li:nth-child(4) { background-color: #FF6D3F; } .fancy .slot li:nth-child(3) { background-color: #FF494C; } .fancy .slot li:nth-child(2) { background-color: #FF3333; } .fancy .slot li:nth-child(1), .fancy .slot li:nth-child(8) { background-color: #FF0000; } .fancy .slot li span { display: block; } /* --------------------------------------------------------------------- ANIMATIONS --------------------------------------------------------------------- */ @-webkit-keyframes winner { 0%, 50%, 100% { -webkit-transform: rotate(0deg); font-size:70px; color: #fff; } 25% { -webkit-transform: rotate(20deg); font-size:90px; color: #FF16D8; } 75% { -webkit-transform: rotate(-20deg); font-size:90px; color: #FF16D8; } } @-moz-keyframes winner {

.slot unordered-list margin/padding issue

Hello Matthew,

First of all, thanks for creating this nice project. It's quite clear and easy for us to use this animation. But I run into some positioning issues while I am trying to modify the margin and padding of the uls of class ".slot". When they are set to 0, as the examples, the final result looks good. But as I modify their value, the three digits of the final result don't seem to be placed at their initial positions. And sometimes, they aren't vertically-aligned as well. Is there any work around? Or this is simply one of constraint? If so, maybe it should be mentioned in the readme file. Thanks.

Horizontal spin

I need to move the object horizontally. Anyone can help me?

Change spinner option

Hello dude,
Is possible to change the spinner option?
For example, i have a function calling it and after call jSlots and put the options i want to execute the code.
How can i do it?

Suggestion: Allow us to specify winning number

This is more of a suggestion or question on how we can modify the code to allow us to specify the winning number beforehand and then have it spin to this number?
Many thanks for this great piece of code.

Fired Event on click and then pass the endNumber

Hi, Is there a way to fired the slots start event when i click on an element but not like you have the plugin right now, i mean something like:

$('selector').click(function(){
//Get Ajax request with new array
var _endNumber = $.ajax() //etc
slots.endNumbers = _endNumber;
slots.start();
}

Thanks in advance for your help.

Do not clone only the first li item

you should clone:

$list.find('li').clone().appendTo($list);

instead of

$li.clone().appendTo($list);

otherwise the first letter has a bigger chance to win.

Get the selected <li>

I need the result of the spin, for example:

<ul class="slot">
     <li>a</li>
     <li>b</li>
</ul>

Part of js code:

onWin: function() {
   alert("Selected li #" + selectedLi);
},

And for example, I pressed the button and the first li (a) is the selected, but in the js code, I dont know hot to get the selected li.

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.