解决方案 »

  1.   


    <html>
    <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script>
    <script type="text/javascript">
    var i = 0;
    var st;
    $(document).ready(function(){
      $("input").click(function(){
        st = setInterval(sleep,2000);
        
      })
      
    });
    function sleep(numberMillis) {
        var span = $("span");
        var len = $("span").length;    for(;i<len;){
          $(span[i]).animate({fontSize:"50px"},1000,function(){
        $(this).animate({fontSize:"20px"},10000);
        });
          i++ 
          break;
        }
        if(i == len){
          clearInterval(st);
        }
    }
    </script>
    </head>
    <body>
    <input type="button" value="Start"><br/>
    <span>H</span> <span>e</span> <span>l</span> <span>l</span> <span>o</span> <span>,</span> <span>W</span> <span>o</span> <span>r</span> <span>l</span> <span>d</span> <span>!</span>
    </body></html>
    可以实现你要的功能但是效果不是很好 自己在优化下
      

  2.   


    <html>
    <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script>
    <style>
    div{line-height:60px;text-align:center}
    </style>
    <script type="text/javascript">
    $(document).ready(function(){
    var span=$("span"),arr=[60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5,5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5,5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60],l=0,k;
      $("input").click(function(){
        setInterval(function(){
    $.each(span,function(i,item){
    $(item).css("font-size",arr[l+i]+"px");
    });
    l=l>22?0:l+1;
    },100);    
    })  
    });
    </script>
    </head>
    <body>
    <input type="button" value="Start">
    <div>
    <span>H</span> <span>e</span> <span>l</span> <span>l</span> <span>o</span> <span>,</span> <span>W</span> <span>o</span> <span>r</span> <span>l</span> <span>d</span> <span>!</span>
    </div>
    </body></html>