通过js在android上面的接口获取了屏幕的宽高
通过div的width设置网页的宽
通过div的height设置网页的高但试了好多次都没用(宽高传递是正确的,因为我打印出来的结果是320,480)
听说是通过js调用css,来实现设置,但是我又不会jquery,求高手帮个忙
大概的意思就是如何通过js来设置div的宽和高

解决方案 »

  1.   

    $("#div1").height(""); 
    $("#div2").width(""); 
      

  2.   

    <div id="demo" style="background-color:#900;"></div>
    <script type="text/javascript">
    var demo = document.getElementById('demo');
    demo.style.width = '200px';
    demo.style.height = '200px';
    </script>
      

  3.   


    var node=document.getElementById("xx");
    node.style.cssText+="width:320px;height:480px;";
      

  4.   


    $("div1").css("height","320px");
    $("div1").css("width","480px");
    jQuery