js动态设置元素的宽高


   实现代码:

 var html = document.getElementsByTagName('html')[0];
        var dl_second_nav=document.getElementsByClassName("dl-second-nav")[0];
        var J_NavContent=document.getElementById("J_NavContent");
        html.style.height = 2500+'px';
//        alert(dl_second_nav.style.height);
        dl_second_nav.style.height=2400+'px';
        J_NavContent.style.height=2400+'px';



本文转载:CSDN博客