文字改变,需要平滑

时间:2014-02-10 18:09:44

标签: javascript html

我做了这个会改变文字的脚本。有人可以帮我平滑文本,所以过渡都是相同的长度和更顺畅?有些人需要比其他人更长的时间,有些人真的是跳跃和突然。谢谢你们

这是我到目前为止所拥有的。快速回顾,平滑和计时

    <div id="LoadingText">Loading sassy text..</div>
    <script type="text/javascript">
    keywords = 
    [
    "Killing people" , "Eating Chips" , "Developing E2" , "Breaking Roleplay" , "Stealing Printers" , "Rotating Flux Capacitors" , "Activating Time Warp" , "Watching Doctor Who" , "Borealis-ing barrels" , "Makin' bacon" , "Adding Garry" , "Writing code" , "HES GOT A BOMB!" , "< witty comment goes here >" , "Slapping Terry" , "Where's Terry" , "Who's Terry" , "Oscilating lemons"
    ]

    var bCanChangeStatus = true;
    function ChangeText ( )   {
    if ( bCanChangeStatus )
    {
    var keyword = keywords[ Math.floor( Math.random() * keywords.length ) ]
    document.getElementById( "LoadingText" ).innerHTML = keyword;
    }

    setTimeout( "ChangeText()", 2200 );
    }

    ChangeText();

    RefreshFileBox();
    </script>   
谢谢你们! :)

0 个答案:

没有答案