<script>
function hideorshow(id)
{
var table=document.getElementById(id);
if(table==null)alert(111);
if(table.style.display=='block')
table.style.display='none';
else
table.style.display='block';
}
</script>
<body> <table border=1>
<tr>
<td onclick="hideorshow('t1')" onmouseover="this.style.cursor='hand'">navigation1 </td>
</tr>
</table>
<table border=1 id="t1" style="display:block"> <tr> <td>menu1 </td> </tr>
<tr> <td>menu2 </td> </tr>
<tr> <td>menu3 </td> </tr>
<tr> <td>menu4 </td> </tr>
</table> </body>
</html>
解决方案 »
- 添加多行信息后如何传输到数据库中!!
- webservice的一个问题,求救!(急!急!急!)
- 关于转码问题(html到jsp)
- servlet-api 源码问题
- 在打开网页时,不做任何操作,就想看到从数据库是中调出来的数据,怎样实现?
- 现在在做一个基于struts的系统,想实现如下功能:用户提交的表单经过validata()校验后,页面上不符合条件的表单输入项背景变为红色,从而
- 为什么报oracle Management sever 中某项服务尚未完全初始化啊?为什么启动电脑后有三个oracle进程啊?我怎样解决这二个问题啊?谢谢!
- 编译出错
- 怪事 apache2.0.43+tomcat4+struts+log4j 结果找不到log4j的包!
- 急~~ 为什么这个jsp总报错(调试了一天了。。)高手请帮忙!!
- 关于return的用法,看了这么多帖子还是糊涂
- 那个web上分页怎么弄啊?
<script>
functionhideorshow(id)
{
vartable=document.getElementById(id); //根据id获取对象
if(table==null) alert(111); //如果对象为空,打印111
if(table.style.display=='block') //如果对象不可见
table.style.display='none'; //那么将对象隐藏
else
table.style.display='block'; //否则显示
}
</script>
<body>
<tableborder=1>
<tr>
<td onclick="hideorshow('t1')"onmouseover="this.style.cursor='hand'">navigation1
</td>
</tr>
</table>
<tableborder=1id="t1"style="display:block"><tr><td>menu1</…
<script>
//对应单击单元格的函数
function hideorshow(id)
{
//var table=document.getElementById(id); //此时只有一个id
var table=document.getElementById("t1");//如果有多个id,根据id获取对象
if(table==null)alert(111); //如果无此对象,就弹出111的信息
//判断此对象现在是否是显示
if(table.style.display=='block')
//如果当前是显示,就隐藏起来
table.style.display='none';
else
//如果当前是隐藏,就显示出来
table.style.display='block';
}
</script>
<body> <table border=1>
<tr>
<!--onclick:点击此单元格调用此函数,鼠标移到此单元格上鼠标显示为手型-->
<td onclick="hideorshow('t1')" onmouseover="this.style.cursor='hand'">navigation1 </td>
</tr>
</table>
<!--style="display:block"让这个表格充满所在区域(也就是显示)--->
<table border=1 id="t1" style="display:block"> <tr> <td>menu1 </td> </tr>
<tr> <td>menu2 </td> </tr>
<tr> <td>menu3 </td> </tr>
<tr> <td>menu4 </td> </tr>
</table> </body>
</html>