比如说这样:function judge(){
if(screen.width<=1024){
document.getElementById('float').style.top="0px";
} else {
document.getElementById('float').style.bottom="0px";
}
}在IE6下面没效果,只有30分了,全部送

解决方案 »

  1.   

    js这么写没问题是不是你样式有问题~·float都有什么样式?
      

  2.   

    问题是:IE6不支持top属性啊
      

  3.   

    document.getElementById('float').style["top"]="0px"; 先试下 正在解决
      

  4.   

    我先贴出我的样式#float /* 左侧固定 */{z-index: 100;                         
    overflow: visible;
    position: fixed;
                                                    
    _position: absolute;                                       
    _top: expression(documentElement.scrollTop );
    width:150px;
    height:619px;
      

  5.   


    function judge(){
    if(screen.width<=1024){
    document.getElementById('float').getBoundingClientRect().top="0px";
    } else {
    document.getElementById('float').getBoundingClientRect().bottom="0px";
    }
    }以前getBoundingClientRect()是IE特有的,目前FF3+,opera9.5+,safari 4,都已经支持这个方法。
      

  6.   

    position: fixed;
    这个IE6支持?
      

  7.   

    不支持,所以有这个:_position: absolute;   
    _top: expression(documentElement.scrollTop );