obj2.currentStyle.height
怎么传递值进去啊?
用 obj2.currentStyle.height=s; 不行啊

解决方案 »

  1.   

    用style设值
    obj2.style.height=s
      

  2.   

    楼主 css,dom  好象没那个概念
      

  3.   

    obj2.style.heigh=obj2.style.heigh+2;
     这样会出项错误啊
      

  4.   

    obj2.style.height=obj2.style.height+2; 
      

  5.   

    obj2.style.height=parseInt(obj2.currentStyle.height) + 2;
      

  6.   

    obj2.style.height=parseInt(obj2.currentStyle.height) + 2 + "px";
      

  7.   

    obj2.style.height=parseInt(obj2.currentStyle.height) + 2 + "px";
      

  8.   

    LZ的obj2.currentStyle是IE的专有属性,这个属性是经过计算后的原属样式集合,是个只读属性
    要修改样式属性用obj2.style
    还有像width、height这类属性是带单位的,需要parseInt转换,自己赋值也要带单位