欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          javascript怎么設(shè)置高

          javascript設(shè)置高的方法:首先獲取指定id的element;然后得到“p_count”目前的高;最后通過“$("p_count").style.height="900"+"px";”設(shè)置定高即可。

          javascript怎么設(shè)置高

          本文操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

          javascript怎么設(shè)置高?

          js設(shè)置指定div的高度

          代碼如下:

          <script type="text/javascript"> function $(id){ //獲指定id的element,方法形如jQuery return document.getElementById(id); } function getHeight(){ var a=$("p_count").offsetHeight; //得到p_count目前的高 if(a>1000) { //alert(a); } else{ $("p_count").style.height="900"+"px"; //設(shè)定定高 } } window.οnlοad=function(){ getHeight(); } </script> <div id="p_count" style="border:1px solid #ccc">lalala</div>

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號