以下是漸變的js代碼(表示多余三行的要隱藏,點擊"more"顯示剩下的,點擊“less”要逐漸隱藏):
復制代碼 代碼如下:
function showAccomplishmentTableRow(){
$("#accomplishmenttable tr:hidden").first().show(2000,function(){
showAccomplishmentTableRow();
});
if($("#accomplishmenttable tr:hidden").size()==0){
$("#accomplishmenttable").next().attr("onclick","hideAccomplishmentTableRow()").text("Less");
}
}
function hideAccomplishmentTableRow(){
if($("#accomplishmenttable tr:visible").size()<=3){
$("#accomplishmenttable").next().attr("onclick","showAccomplishmentTableRow()").text("More");
return;
}
$("#accomplishmenttable tr:visible").last().hide(2000,function(){
hideAccomplishmentTableRow();
});
}
復制代碼 代碼如下:
<table>
<tbody>
<tr>
<th colspan="2">MY ACCOMPLISHMENTS</th>
</tr>
<tr>
<td>
<div>border_bottom1Pgreye7e7e7</div>
</td>
<td>
border_bottom1Pgreye7e7e7
</td>
</tr>
<tr>
<td>
<div>border_bottom1Pgreye7e7e7</div>
</td>
<td>
border_bottom1Pgreye7e7e7
</td>
</tr>
</tbody>
</table>
<div>More</div>
新聞熱點
疑難解答
圖片精選