<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>top ad</title>
<style type= "Text/css" >
Body{margin:0 auto;padding:0;}
A:focus{outline:none;}
#ad {background: #e8e8e8; width:960px; display:none;margin:0 auto;text-align:center;overflow:hidden;position: relative;}
. slide{width:960px;margin:0 auto;background:gray;text-align:center;height:40px;line-height:40px;color: #fff;}
#colse {width:30px;height:30px;background-color: #666; color: #fff;p osition:absolute;top:0;right:0;font-size:12px; line-height:30px;}
</style>
<body>
<div id= "AD" >
<span id= "Colse" > Close </span>
</div>
<p class= "Slide" > Popular net Welcome </p>
</body>
<script type= "Text/javascript" >
var Tim = 0, time = 0, timer = 0, TTL = +, TT = 5000;
var h = 0, maxh = 200;
function Addh () {
var ele = document.getElementById (' ad ');
if (H < maxh) {
Ele.style.display = ' block ';
H = h + 5;
Ele.style.height = h + ' px ';
}else{
Return
}
Cleartimeout (time);
Time = SetTimeout (Addh, TTL);
}function Dech () {
var ele = document.getElementById (' ad ');
if (H > 0) {
h = h-5;
Ele.style.height = h + ' px ';
}else{
Ele.style.display = ' None ';
}
Cleartimeout (Tim);
Tim = SetTimeout (Dech, TTL);
}function Colsefun () {
Cleartimeout (time);
Cleartimeout (timer);
Dech ();
}
Window.onload = function () {
ADDH ();
var colsebtn = document.getElementById (' Colse ');
Colsebtn.onclick = Colsefun;
Cleartimeout (timer);
Timer = SetTimeout (Dech, TT);
}
</script>
javascript-AD Effect