控制DIV高度
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>控制DIV高度</title>
<style type="text/css">
#wrap{width:200px;height:1px;overflow:hidden;border:1px solid green;}
</style>
</head>
<body>
<input type="button" value="显示" onclick="display()" />
<div id="wrap">
<input type="text" value="werp"/>
</div>
<script type="text/javascript">
var i=0;
function display()
{
var wrap=document.getElementById("wrap");
if(i==0)
{
wrap.style.height=0;
i=1;
}else
{
wrap.style.height=100;
i=0;
}
}
</script>
</body>
</html>
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>控制DIV高度</title>
<style type="text/css">
#wrap{width:200px;height:1px;overflow:hidden;border:1px solid green;}
</style>
</head>
<body>
<input type="button" value="显示" onclick="display()" />
<div id="wrap">
<input type="text" value="werp"/>
</div>
<script type="text/javascript">
var i=0;
function display()
{
var wrap=document.getElementById("wrap");
if(i==0)
{
wrap.style.height=0;
i=1;
}else
{
wrap.style.height=100;
i=0;
}
}
</script>
</body>
</html>