一.html页面 默认折叠
<div class="content">
<div class="title" >
<table border="0" cellpadding="0" cellspacing="0" id="riskShowDiv">
<tr>
<td align="left" colspan="2">我的标签</td>
<td style="text-align: right;"><img src="../../../images/ico25.gif" alt=""></td>
</tr>
</table>
</div>
<div class="info" id="surveyInfo" style="display: none">
<table>
<tr>
<th >问题:</th>
<th style="text-align: center;">答案:</th>
<th style="text-align: center;">分值:</th>
</tr>
</table>
</div>
</div>
二.js toggle事件触发 展示或隐藏
$("#riskShowDiv").toggle(
function () {
$("#surveyInfo").css("display", "block");
},
function () {
$("#surveyInfo").css("display", "none");
}
)
三.页面效果
1.折叠
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201203101531280.png)
2.展开
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201203101950352.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4Njc1Mzcz,size_16,color_FFFFFF,t_70)