提示:您可以先修改部分代码再运行
<!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=gb2312" />
<title>无标题文档</title>
<style>
*{margin:0;padding:0;}
body {height:2000px;}
#menu {
width:220px;
height:420px;
position:absolute;
z-index:1000;
background:url(http://www.qqdang.net/code/menutop.gif) repeat-x top left;
}
#menu_h {
float:right;
}
#menu_h img {
cursor:pointer;
}
#menu_c {
width:188px;
height:398px;
border:1px solid #666;
background:#ecf6f5;
margin:12px 0 0 5px;
}
#menu_c h2 {
text-align:center;
}
</style>
</head>
<body>
<div id="ads" style="width:900px;height:300px;background:#369;margin:0 auto;"></div>
<script type="text/javascript">
var time = 300;
var h = 0;
function addCount()
{
if(time>0)
{
time--;
h = h+5;
}
else
{
return;
}
if(h>300) //高度
{
return;
}
document.getElementById("ads").style.display = "";
document.getElementById("ads").style.height = h+"px";
setTimeout("addCount()",30);
}
window.onload = function showAds()
{
addCount();
setTimeout("noneAds()",7000); //停留时间自己调了
}
var T = 300;
var N = 300; //高度
function noneAds()
{
if(T>0)
{
T--;
N = N-5;
}
else
{
return;
}
if(N<0)
{
document.getElementById("ads").style.display = "none";
return;
}
document.getElementById("ads").style.height = N+"px";
setTimeout("noneAds()",30);
}
</script>
</body>
</html>
提示:您可以先修改部分代码再运行