How To Scroll Within An Overflow Hidden Div To A Certain Currently Invisible Element?
I have a list of elements within a overflow hidden div. So not all elements are visible. Now, if an element gets activated, it should become visible within the div. How do I scroll
Solution 1:
You can set the scrollTop
of the wrapper div to be the top
of the position
of the active element.
$("#wrapper").scrollTop($("#wrapper").scrollTop() + $("div.element.active").position().top);
Post a Comment for "How To Scroll Within An Overflow Hidden Div To A Certain Currently Invisible Element?"