首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js兑现层的收缩

2012-11-22 
js实现层的收缩htmlheadmeta http-equivContent-Type contenttext/html charsetgb2312titl

js实现层的收缩
<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="30" border="2" cellpadding="0" cellspacing="0" id="mytd" onClicks="over()" onMouseOut="out()"> 
<tr> 
<td>这里面填写内容</td> 
</tr> 
</table> 
</body> 

</html>

热点排行