87,955
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
var d = null;
var sh = null;
var hid = null;
window.onload = function(){
d = document.getElementById("notice");
sh = window.setInterval("show()",10);
};
function show(){
var top = parseInt(d.style.top.replace("px",""));
if(top<0){
d.style.top = (top+1)+"px";
}else{
window.clearInterval(sh);
window.setTimeout("goHidden()",5000);//5秒后收缩起来
}
}
function goHidden(){
hid = window.setInterval("hidden()",10);
}
function hidden(){
var top = parseInt(d.style.top.replace("px",""));
if(top>-200){
d.style.top = (top-1)+"px";
}else{
window.clearInterval(hid);
}
}
</script>
</head>
<body>
<div id="notice" style="widht:100%;position:absolute;height:200px;top:-200px;left:0px;">
<img width="100%" height="100%" src="http://d5.sina.com.cn/200912/22/203811_750-450.jpg"/>
</div>
</body>
</html>
<script type="text/javascript" src="Js/jquery-1.3.2.min.js" ></script>
<script type="text/JavaScript">
$(document).ready(function(){
setTimeout("loadNewPage();",2000);
});
function loadNewPage(){
$("#topDiv").slideUp("slow");
}
</script>
<div id="topDiv">123</div>
<div id="mainDiv">123</div>