Scroll the page with JavaScript

In that case I need to scroll my page onclick event to show the fully loaded content in a <div>, which just loaded content.

That can be done with window.scrollBy(x, y). Where if you’d like to scroll vertically you’ve to change the y value.

One thought on “Scroll the page with JavaScript

  1. I just used that 😀

    But I wonder. . . why do U need to show the whole content? U need a preview of the page or there’s another reason???

Leave a Reply

Your email address will not be published. Required fields are marked *