js渐变显示渐变消失示例代码
2023-06-13 09:15:03 时间
以下是渐变的js代码(表示多余三行的要隐藏,点击"more"显示剩下的,点击“less”要逐渐隐藏):
复制代码代码如下:
functionshowAccomplishmentTableRow(){
$("#accomplishmenttabletr:hidden").first().show(2000,function(){
showAccomplishmentTableRow();
});
if($("#accomplishmenttabletr:hidden").size()==0){
$("#accomplishmenttable").next().attr("onclick","hideAccomplishmentTableRow()").text("Less");
}
}
functionhideAccomplishmentTableRow(){
if($("#accomplishmenttabletr:visible").size()<=3){
$("#accomplishmenttable").next().attr("onclick","showAccomplishmentTableRow()").text("More");
return;
}
$("#accomplishmenttabletr:visible").last().hide(2000,function(){
hideAccomplishmentTableRow();
});
}
html
<tableid="accomplishmenttable"class="bgWhiteborder3PGreye7e7e7marginT20roundedCornerwidth100P">
<tbody>
<trclass="bgLightGreyf5f5f5height40">
<thclass="border_bottom3Pgreye7e7e7border_right1Pgreye7e7e7border_top1PWhitefontGreyGeneraltextCenterroundedCorner_TLverticalMiddlewidth30P"colspan="2">MYACCOMPLISHMENTS</th>
</tr>
<trclass="bgWhiteheight40">
<tdclass="border_bottom1Pgreye7e7e7border_right1Pgreye7e7e7fontGreyGeneralp14Fontwidth20P">
<divclass="margin5">border_bottom1Pgreye7e7e7</div>
</td>
<tdclass="border_bottom1Pgreye7e7e7border_right1Pgreye7e7e7fontGreyGeneralp14FonttextLeftwidth80P">
border_bottom1Pgreye7e7e7
</td>
</tr>
<trclass="bgWhiteheight40">
<tdclass="border_bottom1Pgreye7e7e7border_right1Pgreye7e7e7fontGreyGeneralp14Fontwidth20P">
<divclass="margin5">border_bottom1Pgreye7e7e7</div>
</td>
<tdclass="border_bottom1Pgreye7e7e7border_right1Pgreye7e7e7fontGreyGeneralp14FonttextLeftwidth80P">
border_bottom1Pgreye7e7e7
</td>
</tr>
</tbody>
</table>
<divclass="floatRmarginT5p14FonttextLink"onclick="showAccomplishmentTableRow();">More</div>
相关文章
- [html]js无缝循环滚动图片示例代码
- 用SQL Server和JS实现数据库管理技术(sqlserver.js)
- 复制本贴标题和地址的js代码
- JS小练习代码之二
- 动态为事件添加js代码示例
- JS判断undefined的实现代码
- js获取Listbox选择的值的代码
- js创建子窗口并且回传值示例代码
- js调用父窗口的具体实现代码
- IE下JS读取xml文件示例代码
- js实现inputtype="file"文件上传示例代码
- js冒泡法和数组转换成字符串示例代码
- js控制表单操作的常用代码小结
- js的onload事件及初始化按钮事件示例代码
- js动态添加事件并可传参数示例代码
- js中cookie的添加、取值、删除示例代码
- JS关闭窗口或JS关闭页面的几种代码分享
- js/jquery去掉空格,回车,换行示例代码
- 代码触发js事件(click、change)示例应用
- js获取url中指定参数值的示例代码
- JS和Jquery获取和修改label的值的示例代码
- JS判断两个时间大小的示例代码
- js设置文本框中焦点位置在最后的示例代码(简单实用)
- js简单的表格添加行和删除行操作示例
- JS下载文件|无刷新下载文件示例代码
- 用box固定长宽实现图片自动轮播js代码
- 使用原生js实现页面蒙灰(mask)效果示例代码