HTML-字体逐渐显示

<style type="text/css">
#shi
{
    font-size:25px;
    color:#09F;
    height:25px;
    font-weight:bold;
    width:500px;
}
</style>
</head>

<body>
<div id="wai" style="width:0px; height:26px; overflow:hidden">
    <div id="shi">安得广厦千万间,大庇天下寒士俱欢颜</div> </div> </body> <script type="text/javascript">
showshi();
function showshi()
{
    var s= document.getElementById("wai");
    if(parseInt(s.style.width)<500)
    {
    var w=parseInt(s.style.width)+1;
    s.style.width=w+"px";
    window.setTimeout("showshi()",20);
    }
}
</script>

posted @ 2015-08-31 09:08  断肠人—断肠人  阅读(559)  评论(0编辑  收藏  举报