我也放个栏目切换代码,简简单单的
2009-10-17 10:52:00 来源:WEB开发网吭哧吭哧了一上午,把163.com的栏目切换给扒下来了。我把css给去掉了。改用表格控制。喜欢这种不用层控制的东西。不知道对大家有没有用。有点不好就是把模板拉的老长。
发出来。给大家看看。:)
---------------------------------------------------
<script language="javascript">
function setFocus3(i)
{
selectLayer3(i);
}
function selectLayer3(i)
{
switch(i)
{
case 1:
document.getElementById("N1").style.display="block";
document.getElementById("N2").style.display="none";
document.getElementById("N3").style.display="none";
document.getElementById("N4").style.display="none";
document.getElementById("N5").style.display="none";
document.getElementById("N6").style.display="none";
break;
case 2:
document.getElementById("N1").style.display="none";
document.getElementById("N2").style.display="block";
document.getElementById("N3").style.display="none";
document.getElementById("N4").style.display="none";
document.getElementById("N5").style.display="none";
document.getElementById("N6").style.display="none";
break;
case 3:
document.getElementById("N1").style.display="none";
document.getElementById("N2").style.display="none";
document.getElementById("N3").style.display="block";
document.getElementById("N4").style.display="none";
document.getElementById("N5").style.display="none";
document.getElementById("N6").style.display="none";
break;
case 4:
document.getElementById("N1").style.display="none";
document.getElementById("N2").style.display="none";
document.getElementById("N3").style.display="none";
document.getElementById("N4").style.display="block";
document.getElementById("N5").style.display="none";
document.getElementById("N6").style.display="none";
break;
case 5:
document.getElementById("N1").style.display="none";
document.getElementById("N2").style.display="none";
document.getElementById("N3").style.display="none";
document.getElementById("N4").style.display="none";
document.getElementById("N5").style.display="block";
document.getElementById("N6").style.display="none";
break;
case 6:
document.getElementById("N1").style.display="none";
document.getElementById("N2").style.display="none";
document.getElementById("N3").style.display="none";
document.getElementById("N4").style.display="none";
document.getElementById("N5").style.display="none";
document.getElementById("N6").style.display="block";
break;
}
}
</script>
<div id="N1" style="display:block;">
<div >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80"><a href="http://education.163.com/gaokao/" target="_blank">高考</a></td>
<td width="80"><a href="javascript:setFocus3(2);" onMouseOver="javascript:setFocus3(2);" target="_self">自考</a></td>
<td width="80"><a href="javascript:setFocus3(3);" onMouseOver="javascript:setFocus3(3);" target="_self">考研</a></td>
<td width="80"><a href="javascript:setFocus3(4);" onMouseOver="javascript:setFocus3(4);" target="_self">四六级</a></td>
<td><a href="javascript:setFocus3(5);" onMouseOver="javascript:setFocus3(5);" target="_self">公务员</a></td>
更多精彩
赞助商链接