posts - 495,comments - 227,trackbacks - 0

<script>
var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;


function FloatMenu() {
docWidth = document.body.clientWidth-100; // update document width
docHeight = document.body.clientHeight; // update document height
oldScrollPos = scrollPos;
scrollPos = document.body.scrollTop; // update scrollbar position
if(scrollPos > 200) scrollPos = 180;

Xpos = docWidth; //坷弗率 咯归
Yboundary = scrollPos + 135;

if (floater.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos += 3;

if (floater.offsetTop > Yboundary + 10) // Object is past boundary
Ypos -= 3;

Ypos *= Ygravity; // Slow object down

floater.style.pixelLeft = Xpos;
floater.style.pixelTop += Ypos; // Make object bounce
}

window.setInterval("FloatMenu()", 30); //
</script>

<STYLE>.floater {
POSITION: absolute; HEIGHT: 0px;width:100px;
}
</STYLE>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<div id=floater class=floater>里面可以是图片也可以是表格 ! </div>

 

posted on 2006-09-14 17:17 SIMONE 阅读(251) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: