【发布时间】:2016-08-16 15:31:30
【问题描述】:
我有 5 行伴随着一个显示按钮,点击后我想一次显示两个隐藏的行。然后,我希望在显示最后两行后禁用显示按钮。
这个问题与this 问题非常相似,只是我不能使用答案,因为 display:block css 会改变行内的数据和样式。
<p><a href="#" id="display">Display More</a></p>
<table>
<tr class="showfirstRow">
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr class="secondRow">
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr class="thirdRow">
<td>Lois</td>
<td>Griffin</td>
</tr>
<tr class="fourthRow">
<td>Meg</td>
<td>Griffin</td>
</tr>
<tr class="fithRow">
<td>Stewie</td>
<td>Griffin</td>
</tr>
</table>
$("#display").click(function() {
// show the next hidden div.group, then disable the display button once all rows have been displayed
});
【问题讨论】: