Home > Web Front-end > JS Tutorial > body text

js渐变显示渐变消失示例代码_javascript技巧

WBOY
Release: 2016-05-16 17:27:33
Original
1055 people have browsed it

以下是渐变的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()$("#accomplishmenttable").next().attr("onclick","showAccomplishmentTableRow()").text("More");
return;
}

$("#accomplishmenttable tr:visible").last().hide(2000,function(){
hideAccomplishmentTableRow();
});

}

html
复制代码 代码如下:
















MY ACCOMPLISHMENTS

border_bottom1Pgreye7e7e7


border_bottom1Pgreye7e7e7

border_bottom1Pgreye7e7e7


border_bottom1Pgreye7e7e7



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!