【发布时间】:2023-08-03 08:17:01
【问题描述】:
按钮/参考应该最小化/最大化表格内的一些文本。
您将在下面找到 2 个函数“blend_in”,它可以最大化表格中的文本,“blend_out”可以混合/最小化表格中的文本。 我用 2 个按钮实现了这一点,并希望在同一个按钮/参考上使用这 2 个方法。
function blend_in(id) {
document.getElementById(id).style.display = 'block'
}
function blend_out(id) {
document.getElementById(id).style.display = 'none'
}
<table width="100%">
<tr>
<td>
//this button will open the text inside the table.
<a href="javascript:blend_in('zeile')"> Button 1 </a>
</td>
</tr>
<tr style="display:none;" id="zeile">
<td>
(Text of the table) //the text inside the table which will be opened by clicking "Button 1" and closes by clicking "Button 2"
<a href="javascript:blend_out('zeile')"> Button 2 </a></td>
</tr>
</table>
【问题讨论】:
-
我是否正确假设标题可能是“点击链接时切换一行”?
标签: html button html-table jscript