div层在IE6和IE8上面不兼容,IE6上面显示错位,怎么办?
程序代码:
<html> <head><title>层的滚动效果</title></head> <body> <style> #fbtn{ display:none; overflow:hidden; border-style:solid; border-width:1px; border-color:#e1e1c9 #e1e1c9 #6e6e56 #6e6e56; padding:1 1 1 1; width:140px; height:30px; } #fbtn_txt{ position:relative; } #fbtn_txt div{ margin:0auto; height:30px; padding-top:11px; font-size:14px; font-family:small fonts; color:#FFFFFF; text-align:center; cursor:hand; } #fbtn_mask{ background-color:#005EBB; position:relative; width:100%; height:100%; } .bgcolor{ background:#FFFFFF} .divcolor{ background:#75BAFF} </style> <div class="bgcolor"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="2" bgcolor="#75BAFF"></td> </tr> <tr> <td valign="top"> <div id =divcolor class="divcolor"> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>政策法规</div> <div>政策法规</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>职业标准</div> <div>职业标准</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>鉴定工种</div> <div>鉴定工种</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>证书查询</div> <div>证书查询</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>证书样本</div> <div>证书样本</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>实训基地</div> <div>实训基地</div> </div> </div> <div id=fbtn> <div id=fbtn_mask></div> <div id=fbtn_txt> <div>申报流程</div> <div>申报流程</div> </div> </div> </div></td> <td width="90%">加内容</td> </tr> </table> <script> var current=null; var t=null; for(var i=0;i<fbtn.length;i++){ fbtn_txt[i].style.posTop=-30; fbtn_mask[i].style.posTop=-30; fbtn[i].index=i; fbtn[i].style.display="block"; fbtn[i].onmouseover=function(){ if(!current){ current=this; domove(this.index); } else if(current!=this){ domove(current.index); domove(this.index); current=this; } } fbtn[i].onmouseout=function(){ if(event.toElement==this.parentElement&t==this){ domove(this.index); current=null; } } } function domove(num){ var o=fbtn_txt[num]; var m=fbtn_mask[num]; if(o.style.posTop<-60){ o.style.display="none"; var t=o.children[1].innerHTML; o.children[1].innerHTML=o.children[0].innerHTML; o.children[0].innerHTML=t; o.style.posTop=-30; o.style.display="block"; if(m.style.posTop>30) m.style.posTop=-30; else m.style.posTop=0; } else{ m.style.posTop+=6; o.style.posTop-=6; setTimeout('domove('+num+')',15); } } </script></div> </body> </html> 如果 #fbtn{ display:none; overflow:hidden; border-style:solid; border-width:1px; border-color:#e1e1c9