Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auto scroll to bottom of page with jquery

Tags:

How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page

like image 1000
Web Worm Avatar asked Dec 27 '09 19:12

Web Worm


People also ask

How do I automatically scroll to the bottom of the page?

To use you just need to press CTRL+ Left click of your mouse and drag the mouse a bit in the direction you want to scroll the page. For example, if you want to scroll up to the page automatically, click CTRL+ left click and slightly move your mouse upwards, the tool will start scrolling up the page.

How do I scroll to the bottom in HTML?

scrollTo(0, document. body. scrollHeight);

How do I automatically scroll down a page in HTML?

The first one is with javascript: set the scrollTop property of the scrollable element (e.g. document. body. scrollTop = 1000; ). The second is setting the link to point to a specific id in the page e.g.


1 Answers

This will work in every case, no need to put a 'ridiculous' number in it:

$(document).scrollTop($(document).height()); 
like image 106
Tatu Ulmanen Avatar answered Oct 06 '22 02:10

Tatu Ulmanen