<html>
<head>
    <title></title>
    <script type="text/javascript">
        function showDiv() {
            showIntervalId=setInterval("inc()", 100);
        }
        function inc() {
            var div1 = document.getElementById("div1");
            var oldwidth = div1.style.width;
            oldwidth = parseInt(oldwidth, 10);
            var oldheight = div1.style.height;
            oldheight = parseInt(oldheight, 10);
            if (oldwidth >= 200) {
                clearInterval(showIntervalId);//停止计时器
            }
            oldwidth += 10;
            oldheight += 10;
            div1.style.width = oldwidth + "px";
            div1.style.height = oldheight + "px";
        }   
    </script>
</head>
<body>
<div id="div1" style=" width:10px;height:100px; border-style:solid; border-color:Red; border-width:1px;">
中国人最爱上去找中国网站找不到资源的网站中国人最爱上去找中国网站找不到资源的网站
中国人最爱上去找中国网站找不到资源的网站
中国人最爱上去找中国网站找不到资源的网站
</div>
<input type="button" value="动态放大" onclick="showDiv()" />
</body>
</html>

posted on 2011-09-15 22:17  易成波  阅读(877)  评论(0编辑  收藏  举报