JQuery의 카운트다운

3967 단어 jquery
//      xianshi    

setTimeout(function() {xianshi();}, 10000);





//0.1     xianshi    

setInterval(function() { xianshi(); }, 100);
 0.1       



<html>

    <head>

        <meta name="viewport" content="width=device-width" />

        <title>       </title>

        <script src="~/Scripts/jquery-1.8.2.js"></script>

        <script src="~/Scripts/page/time.js"></script>

    </head>

    <body>

        <div>

            <textarea id="txt" style="width: 100%;height: 500px;" ></textarea>

        </div>

    </body>

</html>
$(function() {   

    for (var i = 0; i < txt.length; i++) {

        arr.push(txt[i]);

    }

    //      

   // setTimeout(function() {xianshi()}, 1000);

    setInterval(function() { xianshi(); }, 100);



});



function xianshi() {

    if (timek < parseInt(txt.length)) {

        result += arr[timek];

        $("#txt").attr("value", result);

        timek++;

    }

}



var result = "";

var timek = 0;

var arr = new Array;

var txt = "                 。      ,                   。                            ,          ,              。";
  

        

$("#txt").attr("value", result);

좋은 웹페이지 즐겨찾기