2016-09-16 4 views
0

私は、フレーズが常に数値を変更しているベットページを作っています。例えば、JavaScriptで数をスムーズに変更する

$6 231 515.23','6 431 515.23','6 831 515.23 

しかし、コーディングは、私はそうStackOverflowのか、他のフォーラムでいくつかの研究でしによる私のために働いていないようですが、親切に助言します。

var first = ['$6 231 515.23', '6 431 515.23', '6 831 515.23']; 
 
var second = ['$6 231 515.23', '6 431 515.23', '6 831 515.23']; 
 
var third = ['$6 231 515.23', '6 431 515.23', '6 831 515.23'] 
 
var i = 0; 
 
var j = 0; 
 
var k = 0; 
 
var maxfirst = first.length - 1; 
 
var maxsecond = second.length - 1; 
 
var maxthird = third.length - 1; 
 

 
function delay() { 
 
    $('#intro').velocity("transi1ion.slideUpIn", 1250); 
 
    setInterval(firstwordchange, 10); 
 
    setInterval(secondwordchange, 500); 
 
    setInterval(thirdwordchange, 500) 
 
} 
 

 
function firstwordchange() { 
 
    if (i < maxfirst) i++; 
 
    else i = 0; 
 

 
    $('#firstword').velocity("transition.slideUpOut", 300); 
 

 
    setTimeout(function() { 
 
    $('#firstword').text(first[i]); 
 
    }, 200); 
 

 
    $('#firstword').velocity("transition.slideUpIn", 300); 
 
} 
 

 
function secondwordchange() { 
 
    if (j < maxsecond) j++; 
 
    else j = 0; 
 

 
    $('#secondword').velocity("transition.slideUpOut", 300); 
 

 
    setTimeout(function() { 
 
    $('#secondword').text(second[j]); 
 
    }, 200); 
 

 
    $('#secondword').velocity("transition.slideUpIn", 300); 
 
} 
 

 
function thirdwordchange() { 
 
    if (j < maxsecond) j++; 
 
    else j = 0; 
 

 
    $('#thirdword').velocity("transition.slideUpOut", 300); 
 

 
    setTimeout(function() { 
 
    $('#thirdword').text(second[j]); 
 
    }, 200); 
 

 
    $('#thirdword').velocity("transition.slideUpIn", 300); 
 
} 
 

 
setTimeout(delay, 700);
.Jacpots_2 { 
 
    left: 110px; 
 
    top: 648px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
} 
 
.introchange2 { 
 
    left: 110px; 
 
    top: 675px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
} 
 
.Jacpots_3 { 
 
    left: 110px; 
 
    top: 755px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
} 
 
.introchange3 { 
 
    left: 110px; 
 
    top: 785px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
} 
 
/*JACKPOT SIDE */ 
 

 
.Jacpots_1 { 
 
    left: 110px; 
 
    top: 545px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
} 
 
.introchange1 { 
 
    left: 110px; 
 
    top: 575px; 
 
    position: absolute; 
 
    font: 14px/43px"Microsoft YaHei"; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<ul class="clearfix"> 
 
    <br> 
 
    <li> 
 
    <div id="ubercontainer"> 
 
     <div id="container"> 
 
     <img src="../images/sideGAME5捕获.jpg"/class="sideGMimg5" " > 
 
     <span class="Jacpots_1">Major Millions</span><br /> 
 
     <span id="firstword" class="introchange1">$6 231 515.23</span> 
 
     <span class="Jacpots_2">Mega Moolah</span><br /> 
 
     <span id="secondword" class="introchange2">$6 231 515.23</span> 
 
     <span class="Jacpots_3">Mega Moolah Isis</span><br /> 
 
     <span id="thirdword" class="introchange3">$6 231 515.23</span> 
 
     </div> 
 
    </div> 
 
    <!-- <span class="Jacpots_1">abc</span> --> 
 
    </li> 
 
    </br> 
 
</ul>

MY IMAGE:その今働いて

<script src="..js/velocity.min.js"></script> 
<script src="..js/velocity.ui.min.js"></script> 

enter image description here

答えて

1

私はJSを含めることを忘れて、私は、イムは、何かが足りないと思います。

関連する問題