Depending on the browser and version, you can tell scrollIntoView to scroll the element in the center of the view-port:
arguments[0].scrollIntoView({block: 'center'});
If it doesn't work, you can still emulate the scrollIntoView by setting scrollLeft and scrollTop on each scrollable container.
This example should scroll the targeted element to the center of the view:
var elm = arguments[0],
doc = elm.ownerDocument || document,
getClientSize = function (max, a, b) {return Math.max(a <= max ? a : 0, b <= max ? b : 0) || max},
clientWidth = getClientSize(doc.defaultView.innerWidth, doc.body.clientWidth, doc.documentElement.clientWidth),
clientHeight = getClientSize(doc.defaultView.innerHeight, doc.body.clientHeight, doc.documentElement.clientHeight),
box = elm.getBoundingClientRect(),
[x, y, w, h] = [box.left, box.top, box.width, box.height],
clientX = Math.max(0, clientWidth - w) * 0.5,
clientY = Math.max(0, clientHeight - h) * 0.5;
for (var e = elm; e; e = e.parentElement || e.offsetParent) {
box = e.offsetParent ? e.getBoundingClientRect() : doc.head.getBoundingClientRect();
x += e.scrollLeft;
y += e.scrollTop;
e.scrollLeft = x - box.left - Math.min(clientX, (e.clientWidth - w) * 0.5);
e.scrollTop = y - box.top - Math.min(clientY, (e.clientHeight - h) * 0.5);
x -= e.scrollLeft;
y -= e.scrollTop;
}