问显示,稳藏代码怎能么写,大家帮帮小女孩,因为刚刚入这行!
<table width= "350 " border= "1 ">
<tr>
<td width= "89 "> 显示1 </td>
<td width= "43 "> 显示2 </td>
<td width= "196 "> 显示3 </td>
</tr>
<tr>
<td colspan= "3 ">
<table width= "300 " border= "1 "> <tr> <td> 显示1内容 </td> </tr> </table>
<table width= "300 " border= "1 "> <tr> <td> 显示2内容 </td> </tr> </table>
<table width= "300 " border= "1 "> <tr> <td> 显示3内容 </td> </tr> </table>
</td>
</tr>
</table>
问题是这样的
1.刚开始是默认 "显示1 ",在表格内显示的是 "显示1内容 " 稳藏 "显示2内容 ", "显示3内容 "
2.点鼠标移到 "显示2 "在表格内显示的是 "显示1内容 " 稳藏 "显示1内容 ", "显示3内容 "
3.当鼠标在移到 "显示3 "时,在表格内显示的是 "显示3内容 " 稳藏 "显示1内容 ", "显示2内容 "
4.当鼠标在移到 "显示1 "时,在表格内显示的是 "显示1内容 " 稳藏 "显示2内容 ", "显示3内容 "
问这代码是如何写!大家帮帮忙! 用JavaScript 或vbScript写都可以,谢谢大家
------解决方案-------------------- <script>
var oldobj = null;
function show(n){
var obj = document.getElementById( "t " + n);
if (oldobj!=null && oldobj != obj) oldobj.style.display= "none ";
obj.style.display= "block ";
oldobj = obj;
}
window.onload=function(){oldobj = document.getElementById( "t1 ");}
</script>
<table width= "350 " border= "1 ">
<tr>
<td width= "89 " onmouseover= "show(1) "> 显示1 </td>
<td width= "43 " onmouseover= "show(2) "> 显示2 </td>
<td width= "196 " onmouseover= "show(3) "> 显示3 </td>
</tr>
<tr>
<td colspan= "3 ">
<table width= "300 " border= "1 " id= "t1 " style= "display:block; "> <tr> <td> 显示1内容 </td> </tr> </table>
<table width= "300 " border= "1 " id= "t2 " style= "display:none; "> <tr> <td> 显示2内容 </td> </tr> </table>
<table width= "300 " border= "1 " id= "t3 " style= "display:none; "> <tr> <td> 显示3内容 </td> </tr> </table>
</td>
</tr>
</table>
------解决方案--------------------小女孩?
------解决方案--------------------强,,不错!~