Scrolling dynamically to the end of the page.

I have a link that animates some height divwhen it hangs, but it divis large heightand goes beyond the visible lower end of the screen.

I need to scroll to see the data, and when I scroll, I leave the hover area and the div switches it heightto 0px.

How to automatically scroll to the end divwhen it switches?

+3
source share
2 answers

You can change the property of the scrollTopbody:

// Scroll all the way to the bottom
document.body.scrollTop = document.body.scrollHeight;
0
source

DIV scrollTop height, :

$("#theDiv").mouseover(function() {
    $(this).scrollTop($(this).height());
});
+1

Source: https://habr.com/ru/post/1740643/


All Articles