87,993
社区成员
发帖
与我相关
我的任务
分享<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
#cc {
width:200px;
height:200px;
background:red;
position:absolute;
top:100%;
left:50px;
}
</style>
</head>
<body>
<div id="cc"></div>
<script>
var cc = document.getElementById("cc");
var time = null;
time=setInterval(function(){
cc.style.top=cc.offsetTop-1+"px";
if(parseInt(cc.style.top)<=0){clearInterval(time)}
},0);
</script>
</body>
</html>