zoukankan      html  css  js  c++  java
  • JavaScript复习--点击按钮,div边框(宽和高)动态增加

     <script type="text/javascript">
            var setinterval;
            function showInc()
            {
                setinterval = setInterval("add()",100);
            }

            function add()
            {
                var ddd = document.getElementById("divv");
                var width = parseInt(ddd.style.width,10);
                var height = parseInt(ddd.style.height, 10);
                width = width + 10;
                height = height + 10;
                if (width>500) {
                    clearInterval(setinterval);
                }
                ddd.style.width = width + "px";
                ddd.style.height = height + "px";
            }
        </script>
    </head>
    <body>
        <div id="divv" style="border:1px solid #0d0c0c;200px;height:200px">
            画鸡
            <table>
                <tr>
                    <td>头上红冠不用彩,</td>
                </tr>
                  <tr>
                    <td>满身雪白走将来。</td>
                </tr>
                 <tr>
                    <td>平生不敢轻言语,</td>
                </tr>
                  <tr>
                    <td> 一叫千门万户开。</td>
                </tr>
            </table>
        </div>
          <input type="button" value="动态增加"  onclick="showInc();"/>
    </body>

  • 相关阅读:
    (转)使用vsphere client 克隆虚拟机
    【转】VIM高级用法笔记
    Oracle RAC的Failover
    /dev/shm过小导致ORA00845错误解决方法
    (转)How to use udev for Oracle ASM in Oracle Linux 6
    ORACLE十进制与十六进制的转换
    解决Oracle RAC不能自动启动的问题
    RAC集群时间同步服务
    db link hang的解决方法
    【转载】Oracle数据恢复 Linux / Unix 误删除的文件恢复
  • 原文地址:https://www.cnblogs.com/fanshaomin/p/3601384.html
Copyright © 2011-2022 走看看