问题描述
网站导航栏当电脑分辨率改变时有偏移,这是一个部分的代码,请大家帮忙看看。<DIVclass=menuid=Layer3onmouseover="this.style.visibility=''"style="Z-INDEX:1;LEFT:345px;VISIBILITY:hidden;WIDTH:60px;POSITION:absolute;TOP:139px;HEIGHT:268px"onmouseout="this.style.visibility='hidden'"><TABLEcellSpacing=1cellPadding=0width="100%"border=0><TBODY><TR><TDbgColor=#02602c><TABLEcellSpacing=0cellPadding=0width="100%"border=0><TBODY><TR><TD><IMGheight=5src=""width=1></TD></TR><TR><TDclass=sub_nav_greenonmouseover="this.className='sub_nav_red';this.style.cursor='hand'"onclick="location.href='newslist1.asp'"onmouseout="this.className='sub_nav_green'"> -动态</TD></TR><TR><TDclass=nav_grayalign=right><IMGsrc="index/sub_nav_dot.gif"></TD></TR><TR><TDclass=sub_nav_greenonmouseover="this.className='sub_nav_red';this.style.cursor='hand'"onclick="location.href='newslist.asp'"onmouseout="this.className='sub_nav_green'"> -新闻</TD></TR><TR><TR><TDclass=nav_grayalign=right><IMGsrc="index/sub_nav_dot.gif"></TD></TR><TR><TDclass=sub_nav_greenonmouseover="this.className='sub_nav_red';this.style.cursor='hand'"onclick="location.href='newslist2.asp'"onmouseout="this.className='sub_nav_green'"> -典型</TD></TR><TDclass=nav_grayalign=right><IMGsrc="index/sub_nav_dot.gif"></TD></TR></TABLE></TD></TR></TBODY></TABLE></DIV>
解决方案
解决方案二:
看你那个DIV的样式就知道问题了<DIVclass=menuid=Layer3onmouseover="this.style.visibility=''"style="Z-INDEX:1;LEFT:345px;VISIBILITY:hidden;WIDTH:60px;POSITION:absolute;TOP:139px;HEIGHT:268px"建议用JS获取到客户端的分辨率之后判断topleftright的位置大小