Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll inside div with jquery?

If I have a div that is overflowing, is there a way I could call a jquery function to scroll it down 60px or something?

like image 862
tarnfeld Avatar asked Mar 21 '10 19:03

tarnfeld


People also ask

How do I scroll an element into a div?

The scrollIntoView method: The scrollIntoView() is used to scroll to the specified element in the browser. Example: Using scrollIntoView() to scroll to an element.

How do you scroll automatically to the bottom of the div using jquery?

To auto scroll a page from top to bottom we can use scrollTop() and height() method in jquery. In this method pass the document's height in scrollTop method to scroll.


2 Answers

Yes you can use ScrollTo plugin.

UPDATE Seems like link is broken now. New link here

like image 128
antyrat Avatar answered Oct 12 '22 23:10

antyrat


Or, simply use the scrollTop() jQuery API call.

like image 34
ayaz Avatar answered Oct 13 '22 00:10

ayaz