Fix autoscrolling when html/body height is set to 100%

When html/body height is set to 100% (so that the body fills the whole viewport) autoscrolling down does not work. Fix this by taking into account the current scroll position.