<div class="htmlarea"> <textarea id="runcode76887"> <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> <table width="316" height="30" border="2" cellpadding="0" cellspacing="0" id="mytd" onmouseover="over()" onmouseout="out()"> <tr> <td>无忧脚本 - 风云突变</td> </tr> </table> </textarea><br><input onclick="runEx('runcode76887')" type="button" value="运行代码"> <input onclick="doCopy('runcode76887')" type="button" value="复制代码"> <input onclick="doSave(runcode76887)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br><br><div class="htmlarea"> <textarea id="runcode68601"> <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> <div id="mytd" onmouseover="over('mytd',200);" onmouseout="out('mytd',30);" style="background:#eee;">代码实例:层的滑动展开/折叠</div> </textarea><br><input onclick="runEx('runcode68601')" type="button" value="运行代码"> <input onclick="doCopy('runcode68601')" type="button" value="复制代码"> <input onclick="doSave(runcode68601)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>