一个层慢慢增高展开,有种向下滑动的效果 时间:2020-05-11 人气:0 <script language="JavaScript"> var act; function over(){ var h = parseInt(mytd.height); if (h < 164){ mytd.height = h + 2; clearTimeout(act); act = setTimeout('over()', 10); } } function out(){ var h = parseInt(mytd.height); if (h > 30){ mytd.height = h - 2; clearTimeout(act); act = setTimeout('out()', 10); } } </script> 无忧脚本 - 风云突变 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] <script type="text/javascript"> //Url: http://bbs.51js.com/thread-61646-1-1.html //Author: 风云突变 //Modify: 枫岩 var act; function over(s,nMax){ var obj=document.getElementById(s); var h = parseInt(obj.offsetHeight); if (h < nMax){ obj.style.height = (h + 2)+"px"; clearTimeout(act); act = setTimeout("over('"+s+"',"+nMax+")", 10); } } function out(s,nMin){ var obj=document.getElementById(s); var h = parseInt(obj.offsetHeight); if (h > nMin){ obj.style.height = (h - 2)+"px"; clearTimeout(act); act = setTimeout("out('"+s+"',"+nMin+")", 10); } } </script> 代码实例:层的滑动展开/折叠 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容