div罩层缓慢向下移动 模拟 慢速加载网页



<div id="shadow" style="width:100%;z-index:999;background-color:white;position:absolute;bottom:0px" >

</div>
<script type="text/javascript">
var ggRoll = {
roll: document.getElementById("shadow"),
speed: 12,
statusY: 1,
y: 0,
winH: document.documentElement.clientHeight - document.getElementById("shadow").offsetHeight,
Go: function () {
this.roll.style.top = this.y + 'px';

this.y = this.y + (this.statusY ? -1 : 1)
if (this.y < 0) { this.statusY = 0 }
if (this.y > this.winH) { clearInterval(interval) }
}
}
var interval = setInterval("ggRoll.Go()", ggRoll.speed);
</script>


posted @ 2015-10-20 04:54  燕儿归  阅读(277)  评论(0编辑  收藏  举报