0
我從josex2r jQuery的老虎機jQuery的老虎機獲得指數的結果,改變背景
這段代碼顯示了這個代碼什麼當前活動通過展示什麼積極的插槽數爲(JS代碼)
<div id="machine1" class="slotMachine">
<div class="slot slot1"></div>
<div class="slot slot2"></div>
<div class="slot slot3"></div>
<div class="slot slot4"></div>
<div class="slot slot5"></div>
<div class="slot slot6"></div>
</div>
<div style="clear:both;">
<div id="machine1Result" class="slotMachine noBorder" style="text-align:left">Index: 0</div>
<div id="machine2Result" class="slotMachine noBorder" style="text-align:left">Index: 1</div>
<div id="machine3Result" class="slotMachine noBorder" style="text-align:left">Index: 2</div>
<div class="slotMachine noBorder"></div>
</div>
function onComplete($el, active){
switch($el[0].id){
case 'machine1':
$("#machine1Result").text("Index: "+active.index);
break;
case 'machine2':
$("#machine2Result").text("Index: "+active.index);
break;
case 'machine3':
$("#machine3Result").text("Index: "+active.index);
break;
}
}
目標是......一旦用戶得到相同的結果說「777」,然後改變一些div的背景。 從這裏實現同樣的目標:Link