All I can find on the web tells me how to scroll the page to the bottom or to an element.
How is it possible to scroll a specific div which has the style "overflow:auto" to the bottom using jQuery?
Yes:
$("#container").scrollTop($("#elementToScrollTo").position().top);
If you want to go smoothly:
$("#container").animate({
scrollTop: $("#elementToScrollTo").position().top
}, 1000);
Here, have a fiddle: http://jsfiddle.net/adrianonantua/nxHE8/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With