M
M
Mark Adams2016-06-07 13:58:33
JavaScript
Mark Adams, 2016-06-07 13:58:33

How to write a script to scroll a page?

We need a script that will scroll the page all the way up, then immediately all the way down.
Why does not it work?

function scrl()
{
    scrollTo(0, 0);
    scrollTo(0, document.body.scrollHeight);
}

Am I calculating the height incorrectly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question