<script language="javascript">
function Initimage()
{
document.getElementByid("gameTab2").style.display="none";
document.getElementByid("game").style.display="none";
document.getELementByid("mobileTable").style.display="none";
}
function TabChange(show,hidden)
{
document.getElementByid(show).style.display="block";//请问这段的Tab1,Tab2是哪来的!display="block";这句什么意思
document.getElementByid(hidden).style.display="none";
document.getElementByid(show+"Tab1").style.display="none";
document.getElementByid(hidden+"Tab2").style.display="none";
document.getElementByid(hidden+"Tab1").style.display="block";
document.getELementByid(show+"Tab2").style.display="block";
}
</script>
</head>
<body onLoad="Initimage()">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img id="gameTab1"
src="#.jpg" width="83" height="47" onMouseOver="TabChange('game','mobile')">
<img id="gameTab2" src="#.html" width="83" height="49"></td>
<td>
<img id="mobileTable1" src="#.jpg" width="81" height="49"
onMouseOver="TabChange('mobile','game')"
<img id="mobileTab2" src="#.jpg" width="82" height="47">
</td></tr>
<tr>
<td colspan="2">
<img id="mobile" src="#.jpg" width="165" height="171">
<img id="game" src="#.jpg" width="164" height="169">
</td>
</tr>
<tr><td colspan="2">
<img src="#.jpg" width="165" height="43">
</td><tr></table>
</body>
function Initimage()
{
document.getElementByid("gameTab2").style.display="none";
document.getElementByid("game").style.display="none";
document.getELementByid("mobileTable").style.display="none";
}
function TabChange(show,hidden)
{
document.getElementByid(show).style.display="block";//请问这段的Tab1,Tab2是哪来的!display="block";这句什么意思
document.getElementByid(hidden).style.display="none";
document.getElementByid(show+"Tab1").style.display="none";
document.getElementByid(hidden+"Tab2").style.display="none";
document.getElementByid(hidden+"Tab1").style.display="block";
document.getELementByid(show+"Tab2").style.display="block";
}
</script>
</head>
<body onLoad="Initimage()">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img id="gameTab1"
src="#.jpg" width="83" height="47" onMouseOver="TabChange('game','mobile')">
<img id="gameTab2" src="#.html" width="83" height="49"></td>
<td>
<img id="mobileTable1" src="#.jpg" width="81" height="49"
onMouseOver="TabChange('mobile','game')"
<img id="mobileTab2" src="#.jpg" width="82" height="47">
</td></tr>
<tr>
<td colspan="2">
<img id="mobile" src="#.jpg" width="165" height="171">
<img id="game" src="#.jpg" width="164" height="169">
</td>
</tr>
<tr><td colspan="2">
<img src="#.jpg" width="165" height="43">
</td><tr></table>
</body>
style.display="block"; //显示该元素 。
style.display="block"; //显示该元素 。
getElementById是根据元素ID获取元素内容
show和hidden就是传进去的'game'和'mobile'
所以
show + "Tab1"就组成了
gameTab1
也就是
document.getElementById("gameTab1")
获取到这个元素style.display 是样式属性里面的显示属性
设为block是让它显示
none是不显示不知道这样解释LZ是否清楚了