Comments (2)
I think there are 2 parts to your question. I'm not testing this, just codespeak and theories
First, you can bind any event to trigger spinning, including custom events. They are bound to the spinner element specified. It could be anything, lets say body is the spinner and spinEvent is spinStart. You could $('body').trigger('spinStart') in your ajax success fn to start it.
There is no way to set the end numbers. This person said they solved it, but I never saw the code working. It might help you. Base is exposed through .data() so you could add it to that for access and on the fly changing
#1
from jquery-jslots.
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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 0
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
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.Sorry for the my English if you can't it understand well
from jquery-jslots.
Related Issues (19)
- Suggestion: Allow us to specify winning number HOT 3
- How to set different values for each slot (one list for each slot)? HOT 1
- Change spinner option
- Horizontal spin HOT 1
- Get the selected <li> HOT 1
- How to call it on a jquery function HOT 2
- How to Set END NUMBERS Solved
- Set one winning slot not more than one? HOT 1
- Set time not working ?
- multiple winner numbers HOT 1
- AutoRun when execute the code HOT 1
- index.html HOT 2
- Up/down option
- loops: Array instead of Number
- Do not clone only the first li item HOT 1
- .slot unordered-list margin/padding issue HOT 2
- start on mouse over or another event HOT 2
- is it possible to store the array of winning numbers so that after the box has finished spinning i can get all the numbers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-jslots.