The following is the gradient of the JS code (said redundant three lines to hide, click "More" to show the rest, click "Less" to gradually hide):
Copy Code code as follows:
function Showaccomplishmenttablerow () {
$ ("#accomplishmenttable Tr:hidden"). A (). 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 ();
});
}
Html
Copy Code code as follows:
<table id= "accomplishmenttable" class= "Bgwhite border3pgreye7e7e7 marginT20 roundedcorner Width100P" >
<tbody>
<tr class= "Bglightgreyf5f5f5 height40" >
<th class= "Border_bottom3pgreye7e7e7 border_right1pgreye7e7e7 border_top1pwhite fontGreyGeneral textCenter Roundedcorner_tl verticalmiddle width30p "colspan=" 2 ">my accomplishments</th>
</tr>
<tr class= "Bgwhite height40" >
<TD class= "Border_bottom1pgreye7e7e7 border_right1pgreye7e7e7 fontgreygeneral P14Font" >
<div class= "Margin5" >border_bottom1Pgreye7e7e7</div>
</td>
<TD class= "Border_bottom1pgreye7e7e7 border_right1pgreye7e7e7 fontgreygeneral p14Font textLeft Width80P" >
Border_bottom1pgreye7e7e7
</td>
</tr>
<tr class= "Bgwhite height40" >
<TD class= "Border_bottom1pgreye7e7e7 border_right1pgreye7e7e7 fontgreygeneral P14Font" >
<div class= "Margin5" >border_bottom1Pgreye7e7e7</div>
</td>
<TD class= "Border_bottom1pgreye7e7e7 border_right1pgreye7e7e7 fontgreygeneral p14Font textLeft Width80P" >
Border_bottom1pgreye7e7e7
</td>
</tr>
</tbody>
</table>
<div class= "Floatr marginT5 p14font textlink" onclick= "Showaccomplishmenttablerow ();" >More</div>