自己写了段代码,是两个重叠的板块,之间层次切换,可是在ie6下兼容性有问题
求教如何修改 .polaroid-tab01{z-index:10}
.polaroid-tab02{z-index:5}
<script type="text/javascript">
function tab1(nIndex){
        var index1=document.getElementById('tab-a');
        var index2=document.getElementById('tab-b');
        if(index2.className='polaroid polaroid-tab01'){
            index2.className='polaroid polaroid-tab02';
index1.className='polaroid polaroid-tab01';
        }else{
}
    }
    function tab2(nIndex){
        var index1=document.getElementById('tab-a');
        var index2=document.getElementById('tab-b');
        if(index1.className='polaroid polaroid-tab01'){
            index2.className='polaroid polaroid-tab01';
index1.className='polaroid polaroid-tab02';
        }else{
}
    }
    </script>

解决方案 »

  1.   

    你if语句判断里面的“=”是不是应该改成“==”?不然就是true~~
      

  2.   


    <div style="width:750px; height:415px; position:relative">
        <div id="tab-a" onclick="tab1()" style="position:absolute; bottom:0; right:0"></div>
        <div id="tab-b" onclick="tab2()" style="position:absolute; top:0; left:0"></div>
    </div>
    我在页面代码有加绝对定位
      

  3.   


    <div style="width:750px; height:415px; position:relative">
       <div class="polaroid polaroid-tab01" id="tab-a" onclick="tab1()" style="position:absolute; bottom:0; right:0"></div>
        <div class="polaroid polaroid-tab02" id="tab-b" onclick="tab2()" style="position:absolute; top:0; left:0"></div>
    </div>
      

  4.   

    是啊,在中国这个尴尬的状况很难改变,一方面微软决策性的将IE绑定在系统中,一方面在中国这个大环境下,盗版XP系统仍占有很大空间