>  기사  >  웹 프론트엔드  >  js渐变显示渐变消失示例代码_javascript技巧

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

WBOY
WBOY원래의
2016-05-16 17:27:331057검색

以下是渐变的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



성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.