点击那个图片,在+的时候下面的表隐藏,-的时候下面的表显示
<html>
<head> <title> 展开还原 </title>
<script language= "javascript ">
instead=0;
function showhide(picobj)
{
var yuan=document.abc.
if(instead%2)
picobj.src= "jia.jpg ";
else
picobj.src= "jian.jpg ";
}
function hide()
{
if(instead==0)
abc.style.display= "block ";
else
abc.style.display= "none ";
}
instead++;
</script>
</head>
<body>
<a href= "javascript:hide() "> <img src= "jia.jpg " id= "pic " onclick= "showhide(pic) " style= "cursor:hand "> </a>
<div id= "abc ">
<table>
<tr> <td> </td> <td> adsfasdf </tr>
<tr> <td> </td> <td> aqwerqwe </tr>
<tr> <td> </td> <td> azcxvzxc </tr>
<tr> <td> </td> <td> gjkghjkh </tr>
<tr> <td> </td> <td> ghjvbnmm </tr>
</table>
</div>
</body>
</html>
------解决方案--------------------三元运算
如果$(s).style.display== "none "
$(s).style.display= " " //:前的那个
如果$(s).style.display != "none "
$(s).style.display= "none " //:后的那个