W3School TIY
脚 本 学 堂 www.jbxue.com
编辑您的代码:
<html> <head> <script type="text/javascript"> txtsize=0 maxsize=100 function writemsg() { if (txtsize<maxsize) { document.getElementById('msg').style.fontSize=txtsize txtsize++ timer=setTimeout("writemsg()",10) } } function stoptimer() { clearTimeout(timer) } </script> </head> <body onload="writemsg()" onunload="stoptimer()"> <p id="msg">W3School.com.cn!</p> </body> </html>
查看结果: