var
currentpos,timer;
function
initialize()
{
timer
=
setInterval(
"
scrollwindow()
"
,
16
);
}
function
sc(){
clearInterval(timer);
}
function
scrollwindow()
{
currentpos
=
document.body.scrollTop;
window.scroll(
0
,
++
currentpos);
if
(currentpos
!=
document.body.scrollTop)
//当滚动到底部时document.body.scrolltop将不再变化,所以currentpos不等于它,将撤销滚动。
sc();
}