以下是代码片段:
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>表格或层往下慢慢展开的效果</title> </head>
<body> <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="10" border="0" cellpadding="0" cellspacing="0" > <tr> <td bgcolor="#990000"></td> </tr> </table> <table width="316" height="30" border="0" cellpadding="0" cellspacing="1" bgcolor="#990000" onMouseOver="over()" onMouseOut="out()" id="mytd"> <tr> <td bgcolor="#FFF0F0" align="center">将鼠标移到这里www.itZcn.net</td> </tr> </table> </body>
</html> |