|
<script language=javascript>
function MmOption(optionId,htmlType,cssType,showId,number,myevent)
{
document.getElementById(showId+number).style.display="block";
var mmArray=document.getElementById(optionId).getElementsByTagName(htmlType);
for(var i=0;i<mmArray.length;i++)
{
mmArray[i].className=(i==number?cssType+"a":cssType+"b");
mmArray[i][myevent]=function()
{
for(var j=0;j<mmArray.length;j++)
{
if(this!=mmArray[j])
{
mmArray[j].className=cssType+"b";
document.getElementById(showId+j).style.display="none";
}
else
{
mmArray[j].className=cssType+"a";
document.getElementById(showId+j).style.display="block";
}
}
}
}
}
window.onload=function()
{
MmOption("nav","ul","t","h",0,"onmouseover");
}
</script>
<div id=nav style="float:left">
<ul style="width:100px">001</ul>
<ul style="width:100px">002</ul>
<ul style="width:100px">003</ul>
</div>
<div id=h0>001的内容</div>
<div id=h1 style="display:none">002的内容</div>
<div id=h2 style="display:none">003的内容</div>
|