【发布时间】:2012-04-19 20:28:06
【问题描述】:
我正在尝试使用一个执行 setTimeout 的函数,然后更改 innerHTML:
<script type="text/javascript">
$(document).ready(function(){
setTimeout(function(){
document.getElementById("middlecolor").innerHTML='new text new text';
}, 1000);
});
</script>
问题:我怎样才能使出现的新文本动画化,即逐行而不是一次全部写入?
感谢您的任何建议!
【问题讨论】:
-
是的。不要使用
.innerHTML。看看这个:stackoverflow.com/questions/1520178/… -
我会做 animate.setTimeout 吗?还是将 jquery html() 放在动画脚本中?
标签: javascript jquery html jquery-animate innerhtml