<script>
var con,con2;
function fly(){
var left=document.getElementById("apDiv1").style.pixelLeft;
var top= document.getElementById("apDiv1").style.pixelTop;//层的位置
var divWidth=document.getElementById("apDiv1").offsetWidth;  // 可见宽度
var divHeight=document.getElementById("apDiv1").offsetHeight;
var Right=document.body.offsetWidth-divWidth;
var Top=document.body.offsetHeight-divHeight;//当前高度
if(left<=0)
{
con=1;
}
    if(left>=Right)
{
con=-1;
}
if(top<=0)
{
con2=1;
}
if(top>=Top)
{
con2=-1;
}
left=left+(con*10);
top=top+(con2*10);
document.getElementById("apDiv1").style.pixelTop=top;
document.getElementById("apDiv1").style.pixelLeft=left;

setTimeout("fly()",200);
}
</script>
怎么它在滚动的时候也漂浮在当前页面?