<script src='http://code.jquery.com/jquery-1.4.2.min.js'></script>
<script>
$(function(){
var str = $('#typewriter').text();
var i = 0;
var typing_inst = setInterval(typing, 100);
function typing()
{
if(i < str.length -1)
{
$('#typewriter').text(str.substr(0,i) + "_");
i++;
}
else if(i == str.length-1)
{
$('#typewriter').text(str);
clearInterval(typing_inst);
}
}
});
</script>
<div id='typewriter'>
嚕啦啦~嚕啦啦~嚕啦嚕啦咧~~
</div>
如何跳行呢?
回覆刪除