How do I scroll an overflowed div to a certain hashtag (anchor)?
Have you tried to set focus()
on the anchor?
Any DOM element with a tabindex is focusable, and any element which has focus will be scrolled into view by the browser.
$('.overflow').scrollTop($('#anchor').offset().top);
There is no reason at all you can't convert this to standard javascript.
Note that the scroll will be off if there is a margin on the anchor element.