查看文章 |
代码片段整理(鼠标滑过变化tab)
2009年10月09日 星期五 17:47
<script> function showBox(showId,aid){ document.getElementById('n1').style.display='none'; document.getElementById('n2').style.display='none'; document.getElementById('n3').style.display='none'; document.getElementById(showId).style.display='block'; document.getElementById('a1').className=""; document.getElementById('a2').className=""; document.getElementById('a3').className=""; document.getElementById(aid).className="selceted"; } </script> <div class="tab"> <div class="tabl"> <a href="#" id="a1" class="selceted" onmouseover="showBox('n1','a1');">第一项</a> <a href="#" id="a2" onmouseover="showBox('n2','a2');" >第二项</a> <a href="#" id="a3" onmouseover="showBox('n3','a3');" >第三项</a> </div> <div class="tabr"> <ul id="n1"> <li>第一项里面的内容</li> </ul> <ul id="n2" style="display:none" class="n2"> <li>第二项里面的内容</li> </ul> <ul id="n3" style="display:none"> <li>第三项里面的内容</li> </ul> </div> </div> </div> |
最近读者: