<html>
<head>
<title>
JavaScript
</title>
<style type="text/css">
p{color:green;}
</style>
</head>
<body bgcolor="green">
<div id="fly" style="background:#ffffff;position: absolute; width: 100px; height:220px; z-index: 1;left: 20px; top: 130px">
<center>
在线老师<p>于老师<p/><p>于老师<p/><p>于老师<p/><p>于老师<p/><p>于老师<p/>
</center>
</div>
<script language="javascript" type="text/javascript">
var already=0;
window.setInterval("move()",1);
function move()
{
curr = document.body.scrollTop;
if(curr!=already)
{
temp=.1*(curr-already);
if(temp>0)temp=Math.ceil(temp);
else temp=Math.floor(temp);
fly.style.pixelTop+=temp;
already+=temp;
}
}
for(i=1;i<1010;i++)
{
document.write(i+"<br>");
}
</script>
</body>
</html>
<head>
<title>
JavaScript
</title>
<style type="text/css">
p{color:green;}
</style>
</head>
<body bgcolor="green">
<div id="fly" style="background:#ffffff;position: absolute; width: 100px; height:220px; z-index: 1;left: 20px; top: 130px">
<center>
在线老师<p>于老师<p/><p>于老师<p/><p>于老师<p/><p>于老师<p/><p>于老师<p/>
</center>
</div>
<script language="javascript" type="text/javascript">
var already=0;
window.setInterval("move()",1);
function move()
{
curr = document.body.scrollTop;
if(curr!=already)
{
temp=.1*(curr-already);
if(temp>0)temp=Math.ceil(temp);
else temp=Math.floor(temp);
fly.style.pixelTop+=temp;
already+=temp;
}
}
for(i=1;i<1010;i++)
{
document.write(i+"<br>");
}
</script>
</body>
</html>